d/tests/installed-tests: Fail if no tests are found
authorSimon McVittie <smcv@debian.org>
Sun, 29 May 2022 12:48:55 +0000 (13:48 +0100)
committerSimon McVittie <smcv@debian.org>
Thu, 2 Jun 2022 10:07:37 +0000 (11:07 +0100)
debian/tests/installed-tests

index 8cf5ea2a89aaeaa512217220a61623f1137c8b90..96d7c0ec94b84981dce40d245db64c7c0bb8d4b1 100755 (executable)
@@ -4,6 +4,8 @@
 
 set -eu
 
+namespace=gtk-4.0/
+
 # Disable gvfs if it happens to be installed. We want to test the built-in
 # stuff
 export GIO_USE_VFS=local
@@ -12,10 +14,15 @@ export GIO_USE_VOLUME_MONITOR=unix
 export XDG_RUNTIME_DIR="$AUTOPKGTEST_TMP"
 export HOME="$AUTOPKGTEST_TMP"
 
-tests=$(gnome-desktop-testing-runner -l gtk-4.0 |
+tests=$(gnome-desktop-testing-runner -l "$namespace" |
     cut -f1 -d' ' |
     grep -v '^gtk-4.0/gtk/templates.test$')
 
+if [ -z "$tests" ]; then
+    echo "Error: no installed-tests found matching $namespace" >&2
+    exit 1
+fi
+
 exec dbus-run-session -- \
 debian/tests/run-with-display $GDK_BACKEND \
 debian/tests/run-with-locales \