Skip to content

Commit 05c51bb

Browse files
committed
ci: fail if requested test name is not found (win32)
Win32: The CMakeLists.txt configures the test names; when we query ctest for the test command-line to run, fail if the tests are not found.
1 parent 623647a commit 05c51bb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ci/test.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ if ($Env:SKIP_TESTS) { exit }
1919
function run_test {
2020
$TestName = $args[0]
2121

22+
$TestCommand = (ctest -N -V -R "^$TestName$") -join "`n"
23+
24+
if (-Not ($TestCommand -match "(?ms).*\n^[0-9]*: Test command: ")) {
25+
echo "Could not find tests: $TestName"
26+
exit
27+
}
28+
2229
$TestCommand = (ctest -N -V -R "^$TestName$") -join "`n" -replace "(?ms).*\n^[0-9]*: Test command: ","" -replace "\n.*",""
2330
$TestCommand += " -r${BuildDir}\results_${TestName}.xml"
2431

25-
Write-Host $TestCommand
2632
Invoke-Expression $TestCommand
27-
2833
if ($LastExitCode -ne 0) { $global:Success = $false }
2934
}
3035

0 commit comments

Comments
 (0)