[gtk+] Add --enable-installed-tests, use it for reftests



commit a8da29b8dbc6241584780e9017ff30cbe50e26d9
Author: Colin Walters <walters verbum org>
Date:   Thu May 9 18:38:08 2013 +0200

    Add --enable-installed-tests, use it for reftests
    
    See https://live.gnome.org/GnomeGoals/InstalledTests
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699601

 configure.ac                    |    5 +++++
 tests/reftests/Makefile.am      |   23 ++++++++++++++++++++++-
 tests/reftests/reftests.test.in |    3 +++
 3 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 00e8cf0..af81c83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,6 +255,11 @@ AC_ARG_ENABLE(rebuilds,
               [AS_HELP_STRING([--disable-rebuilds],
                               [disable all source autogeneration rules])],,
               [enable_rebuilds=yes])
+AC_ARG_ENABLE(installed_tests,
+              AS_HELP_STRING([--enable-installed-tests],
+                             [Install test programs (default: no)]),,
+              [enable_installed_tests=no])
+AM_CONDITIONAL(BUILDOPT_INSTALL_TESTS, test x$enable_installed_tests = xyes)
 
 AC_ARG_ENABLE(gtk2-dependency,
               [AS_HELP_STRING([--enable-gtk2-dependency],
diff --git a/tests/reftests/Makefile.am b/tests/reftests/Makefile.am
index 5431faa..793a0d6 100644
--- a/tests/reftests/Makefile.am
+++ b/tests/reftests/Makefile.am
@@ -30,7 +30,7 @@ EXTRA_DIST += \
        border-image-repeat.sh \
        $(NULL)
 
-EXTRA_DIST += \
+testdata = \
        background-area.css \
        background-area.ref.ui \
        background-area.ui \
@@ -279,4 +279,25 @@ EXTRA_DIST += \
        window-default-size.ui \
        $(NULL)
 
+if BUILDOPT_INSTALL_TESTS
+insttestdir=$(pkglibexecdir)/installed-tests
+insttest_PROGRAMS = gtk-reftest
+
+reftestdir = $(insttestdir)/reftests
+reftest_DATA = $(testdata)
+
+substitutions = \
+       -e s,@pkglibexecdir\@,$(pkglibexecdir),g \
+       $(NULL)
+
+reftests.test: reftests.test.in Makefile
+       $(AM_V_GEN) sed $(substitutions) $< > $  tmp && mv $  tmp $@
+
+EXTRA_DIST += \
+       reftests.test.in
+
+testmetadir = $(datadir)/installed-tests/$(PACKAGE)
+testmeta_DATA = reftests.test
+endif
+ 
 -include $(top_srcdir)/git.mk
diff --git a/tests/reftests/reftests.test.in b/tests/reftests/reftests.test.in
new file mode 100644
index 0000000..0ab2227
--- /dev/null
+++ b/tests/reftests/reftests.test.in
@@ -0,0 +1,3 @@
+[Test]
+Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/gtk-reftest -k --verbose --output $(pwd) --directory 
@pkglibexecdir@/installed-tests/reftests"
+Type=session


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