diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2018-10-26 06:35:57 -0700 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2018-10-26 14:40:01 +0100 |
commit | 05c51bb6ea02e64fe85aa0a56abef6e39c6546a5 (patch) | |
tree | febb305c635c61e21a13d000d0d66e753b2696d9 | |
parent | 623647af9959e0ce8d265ef0060a01b0da6b5fd4 (diff) | |
download | libgit2-05c51bb6ea02e64fe85aa0a56abef6e39c6546a5.tar.gz |
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.
-rw-r--r-- | ci/test.ps1 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ci/test.ps1 b/ci/test.ps1 index 1cf02118f..fdfa1fec7 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 } } |