[gimp/wip/Jehan/ninja-test] build: fix again the `xvfb-run` call to work on various distributions.



commit 98a97ab6eac61685f6c89178430152d9e06a1685
Author: Jehan <jehan girinstud io>
Date:   Sun Nov 14 20:55:19 2021 +0100

    build: fix again the `xvfb-run` call to work on various distributions.
    
    This tool seems like a mess with various implementations (maybe
    distributions patch it?). I'm trying to tweak the script so that it
    works both on the Debian testing/bookworm CI and on my Fedora 33
    desktop.

 build/meson/run_test_env.sh | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/build/meson/run_test_env.sh b/build/meson/run_test_env.sh
index 19a1529d5a..01f10daaca 100644
--- a/build/meson/run_test_env.sh
+++ b/build/meson/run_test_env.sh
@@ -11,7 +11,25 @@ if [ -n "${UI_TEST}" ]; then
   # Also use dbus-run-session to make sure parallel tests aren't failing
   # as they simultaneously try to own the "org.gimp.GIMP.UI" D-Bus name
 
-  xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" \
+  # This is weird but basically on a Debian testing/bookworm, apparently
+  # the --auto-display option does not exist and ends up in error:
+  # > xvfb-run: unrecognized option '--auto-display'
+  #
+  # On a recent Fedora (33 in my case), it exists but a few of the tests
+  # fail with some weirder:
+  # > /usr/bin/xvfb-run: line 186: kill: (53539) - No such process
+  # There using --auto-display instead (supposed to deprecate
+  # --auto-servernum) works fine, but only in its short form (-d). The
+  # long form --auto-display also results in the "unrecognized option"
+  # error even though the help output lists it.
+  xvfb-run 2>&1|grep --quiet auto-display
+  HAS_AUTO_DISPLAY="$?"
+  if [ "$HAS_AUTO_DISPLAY" -eq 0 ]; then
+    OPT="-d"
+  else
+    OPT="--auto-servernum"
+  fi
+  xvfb-run "$OPT" --server-args="-screen 0 1280x1024x24" \
     dbus-run-session -- "$@"
 
 else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]