Commit f22521efe2074a2a4c2764eeaa68c23af50e7fcb

Edward Thomson 2018-10-26T12:31:39

ci: fail if requested test name is not found (unix) POSIX: 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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/ci/test.sh b/ci/test.sh
index 5d7c913..1bc710a 100755
--- a/ci/test.sh
+++ b/ci/test.sh
@@ -44,6 +44,12 @@ failure() {
 # JUnit-style XML files.
 run_test() {
 	TEST_CMD=$(ctest -N -V -R "^${1}$" | sed -n 's/^[0-9]*: Test command: //p')
+
+	if [ -z "$TEST_CMD" ]; then
+		echo "Could not find tests: $1"
+		exit 1
+	fi
+
 	TEST_CMD="${TEST_CMD} -r${BUILD_DIR}/results_${1}.xml"
 
 	if [ "$LEAK_CHECK" = "valgrind" ]; then