[gjs] tests: Run testCommandLine.sh installed



commit 413bd40244fb5ec96c9e4212aa5c1d6937c71c2e
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Dec 17 23:06:40 2016 -0800

    tests: Run testCommandLine.sh installed
    
    This file can be run just as well as an installed test, so we install it
    to the correct directory and add a .test file.
    
    The script now checks for GJS_USE_UNINSTALLED_FILES and tests the
    uninstalled copy of gjs-console if it is set to 1.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775444

 Makefile-insttest.am                               |    8 ++++++--
 Makefile-test.am                                   |    2 +-
 installed-tests/script.test.in                     |    1 +
 .../scripts}/testCommandLine.sh                    |    6 +++++-
 4 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/Makefile-insttest.am b/Makefile-insttest.am
index 4e56bb3..1b1b5c5 100644
--- a/Makefile-insttest.am
+++ b/Makefile-insttest.am
@@ -20,8 +20,12 @@ if BUILDOPT_INSTALL_TESTS
 
 gjsinsttest_PROGRAMS += minijasmine
 gjsinsttest_DATA += $(TEST_INTROSPECTION_TYPELIBS)
-installedtestmeta_DATA += $(jasmine_tests:.js=.test)
+installedtestmeta_DATA +=              \
+       $(jasmine_tests:.js=.test)      \
+       $(simple_tests:%=%.test)        \
+       $(NULL)
 jstests_DATA += $(jasmine_tests)
+jsscripttests_DATA += $(simple_tests)
 pkglib_LTLIBRARIES += libregress.la libwarnlib.la libgimarshallingtests.la
 
 %.test: %.js installed-tests/minijasmine.test.in Makefile
@@ -31,7 +35,7 @@ pkglib_LTLIBRARIES += libregress.la libwarnlib.la libgimarshallingtests.la
                < $(srcdir)/installed-tests/minijasmine.test.in > $@.tmp && \
        mv $@.tmp $@
 
-%.test: installed-tests/scripts/%.js installed-tests/script.test.in Makefile
+%.test: % installed-tests/script.test.in Makefile
        $(AM_V_GEN)$(MKDIR_P) $(@D) && \
        $(SED) -e s,@pkglibexecdir\@,$(pkglibexecdir), \
                -e s,@name\@,$(notdir $<), \
diff --git a/Makefile-test.am b/Makefile-test.am
index 4404f82..b9ac608 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -276,7 +276,7 @@ AM_TESTS_ENVIRONMENT =                                      \
        $(XVFB_START)                                   \
        $(NULL)
 
-simple_tests = test/testCommandLine.sh
+simple_tests = installed-tests/scripts/testCommandLine.sh
 EXTRA_DIST += $(simple_tests)
 
 TESTS =                                \
diff --git a/installed-tests/script.test.in b/installed-tests/script.test.in
index 7fa8a99..02f0583 100644
--- a/installed-tests/script.test.in
+++ b/installed-tests/script.test.in
@@ -1,3 +1,4 @@
 [Test]
 Type=session
 Exec=gjs @pkglibexecdir@/installed-tests/scripts/@name@
+Output=TAP
diff --git a/test/testCommandLine.sh b/installed-tests/scripts/testCommandLine.sh
similarity index 97%
rename from test/testCommandLine.sh
rename to installed-tests/scripts/testCommandLine.sh
index ad4df6b..c9299ab 100755
--- a/test/testCommandLine.sh
+++ b/installed-tests/scripts/testCommandLine.sh
@@ -1,6 +1,10 @@
 #!/bin/sh
 
-gjs="$TOP_BUILDDIR"/gjs-console
+if test $GJS_USE_UNINSTALLED_FILES -eq 1; then
+    gjs="$TOP_BUILDDIR"/gjs-console
+else
+    gjs=gjs-console
+fi
 
 # this JS script fails if either 1) --help is not passed to it, or 2) the string
 # "sentinel" is not in its search path


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