d/rules, d/run-tests.sh: Move loop through backends into run-tests.sh
authorSimon McVittie <smcv@debian.org>
Sat, 14 May 2022 14:48:08 +0000 (15:48 +0100)
committerSimon McVittie <smcv@debian.org>
Sat, 14 May 2022 23:21:16 +0000 (00:21 +0100)
This means that if an X11 test fails, we try the Wayland tests (if we
are running them at all) before failing the build.

debian/rules
debian/run-tests.sh

index 372face80e0453ac70d3671150710364c8118ba4..8c72b135558b49c75d3961304915aa3fc6a23400 100755 (executable)
@@ -256,18 +256,18 @@ ifeq (big,$(DEB_HOST_ARCH_ENDIAN))
 endif
 
 override_dh_auto_test:
-       set -e; for backend in $(test_backends); do \
-               env BUILDDIR=debian/build/deb \
-                       FUZZY_GSK_COMPARE="$(fuzzy_gsk_compare)" \
-                       FUZZY_REFTESTS="$(fuzzy_reftests)" \
-                       IGNORE_GSK_COMPARE="$(ignore_gsk_compare)" \
-                       IGNORE_REFTESTS="$(ignore_reftests)" \
-                       XFAIL_GSK_COMPARE="$(xfail_gsk_compare)" \
-                       XFAIL_REFTESTS="$(xfail_reftests)" \
-                       BACKEND=$$backend \
-                               debian/run-tests.sh -t $(test_timeout_multiplier) \
-                                       $(addprefix --no-suite=,$(skipped_suites)); \
-       done
+       env \
+               BUILDDIR=debian/build/deb \
+               FUZZY_GSK_COMPARE="$(fuzzy_gsk_compare)" \
+               FUZZY_REFTESTS="$(fuzzy_reftests)" \
+               IGNORE_GSK_COMPARE="$(ignore_gsk_compare)" \
+               IGNORE_REFTESTS="$(ignore_reftests)" \
+               XFAIL_GSK_COMPARE="$(xfail_gsk_compare)" \
+               XFAIL_REFTESTS="$(xfail_reftests)" \
+               BACKENDS="$(test_backends)" \
+       debian/run-tests.sh -t $(test_timeout_multiplier) \
+               $(addprefix --no-suite=,$(skipped_suites)) \
+               $(NULL)
 
 override_dh_auto_install:
        dh_auto_install --builddirectory=debian/build/deb --destdir=debian/install/deb
index 3337f285f2990f540ab00ec56a333fffa333c6dd..5a6b42ceea26c509b0f1e6aabaa5e2254f129c31 100755 (executable)
@@ -3,7 +3,7 @@
 set -ex
 
 BUILDDIR=${BUILDDIR:-debian/build/deb}
-BACKEND=${BACKEND:-x11}
+BACKENDS=${BACKENDS:-x11}
 
 FUZZY_GSK_COMPARE=${FUZZY_GSK_COMPARE:-}
 IGNORE_GSK_COMPARE=${IGNORE_GSK_COMPARE:-}
@@ -62,41 +62,43 @@ mkdir -p "$test_data/glib-2.0/schemas/"
 cp gtk/org.gtk.* "$test_data/glib-2.0/schemas/"
 glib-compile-schemas "$test_data/glib-2.0/schemas/"
 
-# Remove LD_PRELOAD so we don't run with fakeroot, which makes dbus-related tests fail
-env \
-    -u LD_PRELOAD \
-    GIO_MODULE_DIR=/nonexistent \
-    GIO_USE_VFS=local \
-    GIO_USE_VOLUME_MONITOR=unix \
-    dbus-run-session -- \
-        debian/tests/run-with-display "$BACKEND" \
-            debian/tests/run-with-locales \
-                --generate de_DE.UTF-8 \
-                --generate en_GB.UTF-8 \
-                --generate en_US.UTF-8 \
-                --generate sv_SE=ISO-8859-1 \
-                -- \
-                    meson test -C "$BUILDDIR" \
-                    --print-errorlogs \
-                    --setup="$BACKEND" \
-                    "$@" \
-        || touch "$test_data/tests-failed"
-
-# Don't base64-encode the image results for tests that upstream
-# expect to fail
-for reftest in $XFAIL_REFTESTS; do
-    rm -f "$BUILDDIR/testsuite/reftests/output/$BACKEND/$reftest.diff.png"
-done
+for BACKEND in $BACKENDS; do
+    # Remove LD_PRELOAD so we don't run with fakeroot, which makes dbus-related tests fail
+    env \
+        -u LD_PRELOAD \
+        GIO_MODULE_DIR=/nonexistent \
+        GIO_USE_VFS=local \
+        GIO_USE_VOLUME_MONITOR=unix \
+        dbus-run-session -- \
+            debian/tests/run-with-display "$BACKEND" \
+                debian/tests/run-with-locales \
+                    --generate de_DE.UTF-8 \
+                    --generate en_GB.UTF-8 \
+                    --generate en_US.UTF-8 \
+                    --generate sv_SE=ISO-8859-1 \
+                    -- \
+                        meson test -C "$BUILDDIR" \
+                        --print-errorlogs \
+                        --setup="$BACKEND" \
+                        "$@" \
+            || touch "$test_data/tests-failed"
+
+    # Don't base64-encode the image results for tests that upstream
+    # expect to fail
+    for reftest in $XFAIL_REFTESTS; do
+        rm -f "$BUILDDIR/testsuite/reftests/output/$BACKEND/$reftest.diff.png"
+    done
 
-for renderer in cairo gl; do
-    for reftest in $XFAIL_GSK_COMPARE; do
-        rm -f "$BUILDDIR/testsuite/gsk/compare/$renderer/$BACKEND/$reftest.diff.png"
+    for renderer in cairo gl; do
+        for reftest in $XFAIL_GSK_COMPARE; do
+            rm -f "$BUILDDIR/testsuite/gsk/compare/$renderer/$BACKEND/$reftest.diff.png"
+        done
     done
-done
 
-if [ -e "$test_data/tests-failed" ]; then
-    head -v -n-0 "$BUILDDIR/meson-logs/testlog-$BACKEND.txt"
-fi
+    if [ -e "$test_data/tests-failed" ]; then
+        head -v -n-0 "$BUILDDIR/meson-logs/testlog-$BACKEND.txt"
+    fi
+done
 
 # Put the rest in the log as base64 since we don't have an
 # equivalent of AUTOPKGTEST_ARTIFACTS for buildds