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.
diff --git a/ci/test.ps1 b/ci/test.ps1
index 1cf0211..fdfa1fe 100644
--- a/ci/test.ps1
+++ b/ci/test.ps1
@@ -19,12 +19,17 @@ if ($Env:SKIP_TESTS) { exit }
function run_test {
$TestName = $args[0]
+ $TestCommand = (ctest -N -V -R "^$TestName$") -join "`n"
+
+ if (-Not ($TestCommand -match "(?ms).*\n^[0-9]*: Test command: ")) {
+ echo "Could not find tests: $TestName"
+ exit
+ }
+
$TestCommand = (ctest -N -V -R "^$TestName$") -join "`n" -replace "(?ms).*\n^[0-9]*: Test command: ","" -replace "\n.*",""
$TestCommand += " -r${BuildDir}\results_${TestName}.xml"
- Write-Host $TestCommand
Invoke-Expression $TestCommand
-
if ($LastExitCode -ne 0) { $global:Success = $false }
}