[gjs] Restore full make check



commit 75b04f0fb5704f2296f38d82ea1f01a78785c4d2
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun May 19 19:05:33 2013 +0200

    Restore full make check
    
    Now that we have --enable-installed-tests, we can use the jsunit
    we build and run it against uninstalled files.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700644

 Makefile-insttest.am       |   15 +++++++++------
 Makefile-test.am           |   10 +---------
 installed-tests/gjs-unit.c |    9 +++++++--
 3 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/Makefile-insttest.am b/Makefile-insttest.am
index 658b1c4..388c127 100644
--- a/Makefile-insttest.am
+++ b/Makefile-insttest.am
@@ -1,4 +1,3 @@
-
 installedtestmetadir = $(datadir)/installed-tests/gjs
 installedtestmeta_DATA = 
 if BUILDOPT_INSTALL_TESTS
@@ -14,6 +13,8 @@ if BUILDOPT_INSTALL_TESTS
 gjsalltests_PROGRAMS += jsunit
 endif
 
+TEST_PROGS += jsunit
+
 jsunit_CPPFLAGS = $(AM_CPPFLAGS) -DPKGLIBDIR=\"$(pkglibdir)\"
 jsunit_CFLAGS = $(AM_CFLAGS) $(GJS_CFLAGS) -I$(top_srcdir)
 jsunit_LDADD = $(GJS_LIBS) libgjs.la
@@ -22,8 +23,11 @@ jsunit_SOURCES = installed-tests/gjs-unit.c
 
 privlibdir = $(pkglibdir)
 privlib_LTLIBRARIES =
+check_LTLIBRARIES =
 if BUILDOPT_INSTALL_TESTS
 privlib_LTLIBRARIES += libregress.la libwarnlib.la libgimarshallingtests.la
+else
+check_LTLIBRARIES += libregress.la libwarnlib.la libgimarshallingtests.la
 endif
 
 nodist_libregress_la_SOURCES = $(GI_DATADIR)/tests/regress.c $(GI_DATADIR)/tests/regress.h
@@ -49,18 +53,14 @@ Regress-1.0.gir: libregress.la
 Regress_1_0_gir_LIBS = libregress.la
 Regress_1_0_gir_FILES = $(nodist_libregress_la_SOURCES)
 Regress_1_0_gir_SCANNERFLAGS = --warn-all --warn-error $(libregress_scannerflags_includes) 
$(libregress_la_CPPFLAGS)
-if BUILDOPT_INSTALL_TESTS
 INTROSPECTION_GIRS += Regress-1.0.gir
-endif
 
 WarnLib-1.0.gir: libwarnlib.la
 WarnLib_1_0_gir_LIBS = libwarnlib.la
 WarnLib_1_0_gir_INCLUDES = Gio-2.0
 WarnLib_1_0_gir_FILES = $(nodist_libwarnlib_la_SOURCES)
 WarnLib_1_0_gir_SCANNERFLAGS = --c-include="warnlib.h" --symbol-prefix=warnlib_
-if BUILDOPT_INSTALL_TESTS
 INTROSPECTION_GIRS += WarnLib-1.0.gir
-endif
 
 GIMarshallingTests-1.0.gir: libgimarshallingtests.la
 GIMarshallingTests_1_0_gir_LIBS = libgimarshallingtests.la
@@ -70,9 +70,12 @@ GIMarshallingTests_1_0_gir_SCANNERFLAGS = --symbol-prefix=gi_marshalling_tests -
 INTROSPECTION_GIRS += GIMarshallingTests-1.0.gir
 
 privtypelibdir = $(pkglibdir)
-privtypelib_DATA = 
+privtypelib_DATA =
+noinst_DATA =
 if BUILDOPT_INSTALL_TESTS
 privtypelib_DATA += $(INTROSPECTION_GIRS:.gir=.typelib)
+else
+noinst_DATA += $(INTROSPECTION_GIRS:.gir=.typelib)
 endif
 
 jstestsdir = $(pkglibdir)/js
diff --git a/Makefile-test.am b/Makefile-test.am
index 5cd0ff3..57094bf 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -22,15 +22,6 @@ gjs_tests_SOURCES =          \
 
 check-local: gjs-tests
        @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} ${TEST_PROGS_OPTIONS}
-       @echo ""
-       @echo "NOTICE"
-       @echo ""
-       @echo "This module contains installed tests.  See"
-       @echo "https://live.gnome.org/GnomeGoals/InstalledTests";
-       @echo "for more information about running them."
-       @echo ""
-       @echo "NOTICE"
-       @echo ""
 
 TESTS_ENVIRONMENT =                                                    \
        TOP_SRCDIR=$(top_srcdir)                                        \
@@ -39,6 +30,7 @@ TESTS_ENVIRONMENT =                                                   \
        GJS_DEBUG_OUTPUT=test_user_data/logs/gjs.log                    \
        BUILDDIR=.                                                      \
        GJS_USE_UNINSTALLED_FILES=1                                     \
+       GJS_PATH=$(top_srcdir)/modules/                                 \
        GJS_TEST_TIMEOUT=420                                            \
        GI_TYPELIB_PATH=$(builddir)                                     \
        LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):$(FIREFOX_JS_LIBDIR)"       \
diff --git a/installed-tests/gjs-unit.c b/installed-tests/gjs-unit.c
index 66532e3..43925ec 100644
--- a/installed-tests/gjs-unit.c
+++ b/installed-tests/gjs-unit.c
@@ -111,8 +111,13 @@ main(int argc, char **argv)
     setlocale(LC_ALL, "");
     g_test_init(&argc, &argv, NULL);
 
-    g_irepository_prepend_search_path(PKGLIBDIR);
-    js_test_dir = g_build_filename(PKGLIBDIR, "js", NULL);
+    if (g_getenv ("GJS_USE_UNINSTALLED_FILES") != NULL) {
+        /* typelib path is handled by the environment */
+        js_test_dir = g_build_filename("installed-tests", "js", NULL);
+    } else {
+        g_irepository_prepend_search_path(PKGLIBDIR);
+        js_test_dir = g_build_filename(PKGLIBDIR, "js", NULL);
+    }
 
     all_tests = read_all_dir_sorted(js_test_dir);
     for (iter = all_tests; iter; iter = iter->next) {


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