Make the Settings Model tests into proper CI tests (#16773)

This pull request removes the need for the SettingsModel tests to run in
a UAP harness and puts them into the standard CI rotation.

This required some changes to `Run-Tests.ps1` to ensure that the right
`te.exe` is selected for each test harness. It's a bit annoying, but for
things that depend on a `resources.pri`, that file must be in the same
directory as the EXE that is hosting the test. Not the DLL, mind you,
the EXE. In our case, that's `TE.ProcessHost.exe`

The bulk of the change is honestly namespace tidying.

Co-authored-by: Mike Griese <migrie@microsoft.com>
Co-authored-by: Leonard Hecker <lhecker@microsoft.com>
This commit is contained in:
Dustin L. Howett
2024-02-29 11:00:04 -06:00
committed by GitHub
parent 94e74d22c6
commit 30dbd3b554
31 changed files with 142 additions and 178 deletions

View File

@@ -169,7 +169,7 @@ function Invoke-OpenConsoleTests()
[switch]$FTOnly,
[parameter(Mandatory=$false)]
[ValidateSet('host', 'interactivityWin32', 'terminal', 'adapter', 'feature', 'uia', 'textbuffer', 'til', 'types', 'terminalCore', 'terminalApp', 'localTerminalApp', 'localSettingsModel', 'unitRemoting', 'unitControl')]
[ValidateSet('host', 'interactivityWin32', 'terminal', 'adapter', 'feature', 'uia', 'textbuffer', 'til', 'types', 'terminalCore', 'terminalApp', 'localTerminalApp', 'unitSettingsModel', 'unitRemoting', 'unitControl')]
[string]$Test,
[parameter(Mandatory=$false)]
@@ -232,13 +232,19 @@ function Invoke-OpenConsoleTests()
# run selected tests
foreach ($t in $TestsToRun)
{
$currentTaefExe = $TaefExePath
if ($t.isolatedTaef -eq "true")
{
$currentTaefExe = (Join-Path (Split-Path (Join-Path $BinDir $t.binary)) "te.exe")
}
if ($t.type -eq "unit")
{
& $TaefExePath "$BinDir\$($t.binary)" $TaefArgs
& $currentTaefExe "$BinDir\$($t.binary)" $TaefArgs
}
elseif ($t.type -eq "ft")
{
Invoke-TaefInNewWindow -OpenConsolePath $OpenConsolePath -TaefPath $TaefExePath -TestDll "$BinDir\$($t.binary)" -TaefArgs $TaefArgs
Invoke-TaefInNewWindow -OpenConsolePath $OpenConsolePath -TaefPath $currentTaefExe -TestDll "$BinDir\$($t.binary)" -TaefArgs $TaefArgs
}
else
{

View File

@@ -13,7 +13,7 @@ if "%PLATFORM%" == "Win32" (
set _TestHostAppPath=%OPENCON%\bin\%_LAST_BUILD_CONF%\TestHostApp
)
call %TAEF% ^
%TAEF% ^
%OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\Conhost.Unit.Tests.dll ^
%OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\TextBuffer.Unit.Tests.dll ^
%OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_TerminalCore\Terminal.Core.Unit.Tests.dll ^
@@ -26,6 +26,16 @@ call %TAEF% ^
%OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_Remoting\Remoting.Unit.Tests.dll ^
%OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_Control\Control.Unit.Tests.dll ^
%_TestHostAppPath%\TerminalApp.LocalTests.dll ^
%_TestHostAppPath%\SettingsModel.LocalTests.dll ^
%*
set _EarlyTestFail=%ERRORLEVEL%
%OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_SettingsModel\te.exe ^
%OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_SettingsModel\SettingsModel.Unit.Tests.dll ^
%*
if %_EarlyTestFail% NEQ 0 (
exit /b %_EarlyTestFail%
)
exit /b %ERRORLEVEL%

View File

@@ -5,7 +5,7 @@
<test name="terminalCore" type="unit" binary="UnitTests_TerminalCore\Terminal.Core.Unit.Tests.dll" />
<test name="terminalApp" type="unit" binary="UnitTests_TerminalApp\Terminal.App.Unit.Tests.dll" />
<test name="localTerminalApp" type="unit" binary="TestHostApp\TerminalApp.LocalTests.dll" />
<test name="localSettingsModel" type="unit" binary="TestHostApp\SettingsModel.LocalTests.dll" />
<test name="unitSettingsModel" type="unit" binary="UnitTests_SettingsModel\SettingsModel.Unit.Tests.dll" isolatedTaef="true" />
<test name="unitRemoting" type="unit" binary="UnitTests_Remoting\Remoting.Unit.Tests.dll" />
<test name="unitControl" type="unit" binary="UnitTests_Control\Control.Unit.Tests.dll" />
<test name="interactivityWin32" type="unit" binary="Conhost.Interactivity.Win32.Unit.Tests.dll" />