Commit 05c51bb6ea02e64fe85aa0a56abef6e39c6546a5

Edward Thomson 2018-10-26T06:35:57

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 }
 }