Commit 05c51bb6 by Edward Thomson

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.
parent 623647af
......@@ -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 }
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment