From e88e690d56f7e5644e342dcc710437ea966e5ccb Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 23 Jun 2013 22:53:13 -0400 Subject: [PATCH] Install conformance tests Install the conformance tests, and metadata to run them with gnome-desktop-testing-runner. https://bugzilla.gnome.org/show_bug.cgi?id=702941 --- configure.ac | 6 ++++++ tests/conform/Makefile.am | 27 ++++++++++++++++++++++++++- tests/conform/test-conform-main.c | 2 +- tests/data/Makefile.am | 5 +++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c9d39f1b0..b7a7c221f 100644 --- a/configure.ac +++ b/configure.ac @@ -192,6 +192,12 @@ AC_ARG_ENABLE([Bsymbolic], AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions]) AC_SUBST(CLUTTER_LINK_FLAGS) +AC_ARG_ENABLE(installed_tests, + AS_HELP_STRING([--enable-installed-tests], + [Install test programs (default: no)]),, + [enable_installed_tests=no]) +AM_CONDITIONAL(ENABLE_INSTALLED_TESTS, test x$enable_installed_tests = xyes) + AC_CACHE_SAVE dnl ======================================================================== diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am index da41027e7..13c6750dc 100644 --- a/tests/conform/Makefile.am +++ b/tests/conform/Makefile.am @@ -286,5 +286,30 @@ DISTCLEANFILES += \ # we override the clean-generic target to clean up the wrappers so # we cannot use CLEANFILES -clean-generic: clean-wrappers +clean-generic: clean-wrappers clean-tests $(QUIET_RM)rm -f $(XML_REPORTS) $(HTML_REPORTS) + +if ENABLE_INSTALLED_TESTS +# installed tests +insttestdir = $(libexecdir)/installed-tests/$(PACKAGE)/conform +insttest_PROGRAMS = test-conformance + +testmetadir = $(datadir)/installed-tests/$(PACKAGE) +testmeta_DATA = $(wildcard *.test) + +BUILT_SOURCES += tests +endif + +.PHONY: tests clean-tests + +tests: stamp-test-conformance + @for i in `cat unit-tests`; do \ + unit=`basename $$i | sed -e s/_/-/g`; \ + echo " GEN $$unit"; \ + echo "[Test]" > $$unit.test; \ + echo "Type=session" >> $$unit.test; \ + echo "Exec=$(libexecdir)/installed-tests/$(PACKAGE)/conform/test-conformance -p $$i" >> $$unit.test; \ + done + +clean-tests: + $(QUIET_RM) rm -f *.test diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c index 7c56671ff..390aac183 100644 --- a/tests/conform/test-conform-main.c +++ b/tests/conform/test-conform-main.c @@ -91,7 +91,7 @@ static TestConformSharedState *shared_state = NULL; gchar * clutter_test_get_data_file (const gchar *filename) { - return g_build_filename (TESTS_DATADIR, filename, NULL); + return g_test_build_filename (G_TEST_DIST, "..", "data", filename, NULL); } static void diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 5c2f00c1d..dc707f3e0 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -26,3 +26,8 @@ png_files = \ $(NULL) EXTRA_DIST = $(json_files) $(png_files) clutter-2.0.suppressions + +if ENABLE_INSTALLED_TESTS +insttestdir = $(libexecdir)/installed-tests/$(PACKAGE)/data +insttest_DATA = $(json_files) $(png_files) +endif