[gegl-gtk] Tests: Run using xvfb-run when available



commit efe5ba4f33974f904c3bd29cdb880ef6acac2bf7
Author: Jon Nordby <jononor gmail com>
Date:   Tue Jul 26 20:32:41 2011 +0200

    Tests: Run using xvfb-run when available

 configure.ac      |   17 +++++++++++++++++
 tests/Makefile.am |   10 +++++++++-
 2 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index badcc20..5b4958f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -253,6 +253,23 @@ AC_CHECK_PROGS(PERL, perl5 perl)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "gegl-gtk-$GEGL_GTK_API_VERSION",
                    [Our gettext translation domain.])
 
+####################
+# Check for xvfb-run
+####################
+
+AC_ARG_WITH(xvfb-run,  [  --without-xvfb-run      Do not use xvfb-run for UI-dependent automatic tests])
+
+have_xvfb_run="no (disabled)"
+if test "x$with_xvfb_run" != "xno"; then
+  AC_PATH_PROG(XVFB_RUN, xvfb-run, no)
+  if test "x$XVFB_RUN" != "xno"; then
+    have_xvfb_run="yes"
+  else
+    have_xvfb_run="no (not found)"
+  fi
+fi
+AM_CONDITIONAL(HAVE_XVFB_RUN, test "x$have_xvfb_run" == "xyes")
+
 #######################
 # Enable extra warnings
 #######################
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ccad802..ecdf0d0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -13,7 +13,15 @@ endif
 
 # ----------------------------------------------
 # Rules for hooking up the unit/functional tests
-GTESTER = gtester
+
+TESTS_ENVIRONMENT = 
+
+# Run tests with xvfb-run if available
+if HAVE_XVFB_RUN
+TESTS_ENVIRONMENT += $(XVFB_RUN) --server-args="-screen 0 1280x1024x24"
+endif
+
+GTESTER = $(TESTS_ENVIRONMENT) gtester
 GTESTER_REPORT = gtester-report
 
 # test: run all tests



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