From a8da29b8dbc6241584780e9017ff30cbe50e26d9 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 9 May 2013 18:38:08 +0200 Subject: [PATCH] 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 deletion(-) create mode 100644 tests/reftests/reftests.test.in diff --git a/configure.ac b/configure.ac index 00e8cf0602..af81c8366f 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 5431faab92..793a0d6cc2 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 0000000000..0ab222733e --- /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