[mutter] build: Add CI test setup to run tests as the CI would do



commit 58fb865a7ccff63e6432d7fe3647b4391924db87
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Fri Aug 27 13:02:42 2021 +0200

    build: Add CI test setup to run tests as the CI would do
    
    This allows to just use meson test _build --setup=CI to run tests with
    the same environment of CI, plus allows to handle wrappers better for
    debugging purposes.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1233>

 .gitlab-ci/run-tests.sh |  5 +----
 meson.build             | 11 +++++++++++
 2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/.gitlab-ci/run-tests.sh b/.gitlab-ci/run-tests.sh
index 0c31393835..80a84eb558 100755
--- a/.gitlab-ci/run-tests.sh
+++ b/.gitlab-ci/run-tests.sh
@@ -13,10 +13,7 @@ PIPEWIRE_DEBUG=2 PIPEWIRE_LOG="$CI_PROJECT_DIR/build/meson-logs/pipewire.log" \
 
 sleep 2
 
-export MUTTER_DEBUG_DUMMY_MODE_SPECS="800x600@10.0"
-
-xvfb-run -s '+iglx -noreset' \
-    meson test -C build --no-rebuild -t 10 --wrap catchsegv
+meson test -C build --no-rebuild --setup CI
 
 exit_code=$?
 
diff --git a/meson.build b/meson.build
index 5cf57e2fa6..6211181bee 100644
--- a/meson.build
+++ b/meson.build
@@ -294,6 +294,17 @@ if have_tests
   have_cogl_tests = get_option('cogl_tests')
   have_clutter_tests = get_option('clutter_tests')
   have_installed_tests = get_option('installed_tests')
+
+  add_test_setup('CI',
+    env: [
+      'MUTTER_DEBUG_DUMMY_MODE_SPECS=800x600@10.0',
+    ],
+    exe_wrapper: [
+      find_program('catchsegv'),
+      find_program('xvfb-run'), '-a', '-s', '+iglx -noreset',
+    ],
+    timeout_multiplier: 10,
+  )
 endif
 
 have_profiler = get_option('profiler')


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