Commit 6ee77e56 authored by Jehan's avatar Jehan

Bug 709878 - test-session-* skipped when xvfb-run is unavailable.

Also add a GIMP_EXIT_TEST_SKIPPED #define, to return the SKIP exit value
documented by automake.
parent f3d40dce
......@@ -18,6 +18,16 @@
#ifndef __TESTS_H__
#define __TESTS_H__
/* Automake doc says:
"When no test protocol is in use, an exit status of 0 from a test
script will denote a success, an exit status of 77 a skipped test,
an exit status of 99 an hard error, and any other exit status will
denote a failure."
Unfortunately glib returns a SUCCESS when you skip tests, which is
not a reliable test feedback. So we hard-code the SKIPPED return
value. */
#define GIMP_EXIT_TEST_SKIPPED 77
Gimp * gimp_init_for_testing (void);
Gimp * gimp_init_for_gui_testing (gboolean show_gui);
......
......@@ -30,6 +30,9 @@
#define ADD_TEST(function) \
g_test_add_func ("/gimp-session-2-6-compatibility/" #function, function);
#define SKIP_TEST(function) \
g_test_add_func ("/gimp-session-2-6-compatibility/subprocess/" #function, function);
/**
* Tests that a sessionrc and dockrc from GIMP 2.6 is loaded and
......@@ -50,8 +53,16 @@ int main(int argc, char **argv)
gimp_test_bail_if_no_display ();
gtk_test_init (&argc, &argv, NULL);
#ifdef HAVE_XVFB_RUN
ADD_TEST (read_and_write_session_files);
#else
SKIP_TEST (read_and_write_session_files);
#endif
/* Don't bother freeing stuff, the process is short-lived */
#ifdef HAVE_XVFB_RUN
return g_test_run ();
#else
return GIMP_EXIT_TEST_SKIPPED;
#endif
}
......@@ -31,6 +31,10 @@
g_test_add_func ("/gimp-session-2-8-compatibility-multi-window/" #function, \
function);
#define SKIP_TEST(function) \
g_test_add_func ("/gimp-session-2-8-compatibility-multi-window/subprocess/" #function, \
function);
/**
* Tests that a single-window sessionrc in GIMP 2.8 format is loaded
......@@ -51,8 +55,16 @@ int main(int argc, char **argv)
gimp_test_bail_if_no_display ();
gtk_test_init (&argc, &argv, NULL);
#ifdef HAVE_XVFB_RUN
ADD_TEST (read_and_write_session_files);
#else
SKIP_TEST (read_and_write_session_files);
#endif
/* Don't bother freeing stuff, the process is short-lived */
#ifdef HAVE_XVFB_RUN
return g_test_run ();
#else
return GIMP_EXIT_TEST_SKIPPED;
#endif
}
......@@ -31,6 +31,9 @@
g_test_add_func ("/gimp-session-2-8-compatibility-single-window/" #function, \
function);
#define SKIP_TEST(function) \
g_test_add_func ("/gimp-session-2-8-compatibility-single-window/subprocess/" #function, \
function);
/**
* Tests that a multi-window sessionrc in GIMP 2.8 format is loaded
......@@ -51,8 +54,16 @@ int main(int argc, char **argv)
gimp_test_bail_if_no_display ();
gtk_test_init (&argc, &argv, NULL);
#ifdef HAVE_XVFB_RUN
ADD_TEST (read_and_write_session_files);
#else
SKIP_TEST (read_and_write_session_files);
#endif
/* Don't bother freeing stuff, the process is short-lived */
#ifdef HAVE_XVFB_RUN
return g_test_run ();
#else
return GIMP_EXIT_TEST_SKIPPED;
#endif
}
......@@ -1960,6 +1960,7 @@ 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"
AC_DEFINE(HAVE_XVFB_RUN, 1, [Define to 1 if xvfb-run is available])
else
have_xvfb_run="no (not found)"
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment