[gjs: 1/4] CI: run some real programs during tests



commit 2379e7427c706e7f325cb2a6316a18efeb41e147
Author: Claudio André <claudioandre br gmail com>
Date:   Mon Jul 9 20:19:25 2018 -0300

    CI: run some real programs during tests

 Makefile-test.am                        |  7 +++++-
 installed-tests/scripts/testExamples.sh | 43 +++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)
---
diff --git a/Makefile-test.am b/Makefile-test.am
index e9080c6e..16982515 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -228,6 +228,10 @@ jasmine_tests +=                                           \
        installed-tests/js/testGObjectDestructionAccess.js      \
        installed-tests/js/testLegacyGtk.js                     \
        $(NULL)
+
+GTK_TESTS_ENVIRONMENT = export ENABLE_GTK=yes;
+else
+GTK_TESTS_ENVIRONMENT =
 endif
 
 if ENABLE_CAIRO
@@ -279,8 +283,9 @@ AM_TESTS_ENVIRONMENT =                                      \
        export G_FILENAME_ENCODING=latin1;              \
        export LSAN_OPTIONS="suppressions=$(abs_top_srcdir)/installed-tests/extra/lsan.supp"; \
        export NO_AT_BRIDGE=1;                          \
-       export LC_ALL=C.UTF-8;               \
+       export LC_ALL=C.UTF-8;                          \
        $(COVERAGE_TESTS_ENVIRONMENT)                   \
+       $(GTK_TESTS_ENVIRONMENT)                        \
        $(XVFB_START)                                   \
        $(DBUS_SESSION_COMMAND)                         \
        $(NULL)
diff --git a/installed-tests/scripts/testExamples.sh b/installed-tests/scripts/testExamples.sh
new file mode 100755
index 00000000..d4a1a233
--- /dev/null
+++ b/installed-tests/scripts/testExamples.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+if test "$GJS_USE_UNINSTALLED_FILES" = "1"; then
+    gjs="$LOG_COMPILER $LOG_FLAGS $TOP_BUILDDIR/gjs-console"
+else
+    gjs="$LOG_COMPILER $LOG_FLAGS gjs-console"
+fi
+
+# Avoid interference in the profiler tests from stray environment variable
+unset GJS_ENABLE_PROFILER
+
+total=0
+
+report () {
+    exit_code=$?
+    total=$((total + 1))
+    if test $exit_code -eq 0; then
+        echo "ok $total - $1"
+    else
+        echo "not ok $total - $1"
+    fi
+}
+
+report_xfail () {
+    exit_code=$?
+    total=$((total + 1))
+    if test $exit_code -ne 0; then
+        echo "ok $total - $1"
+    else
+        echo "not ok $total - $1"
+    fi
+}
+
+skip () {
+    total=$((total + 1))
+    echo "ok $total - $1 # SKIP $2"
+}
+
+# Run the examples
+$gjs examples/gio-cat.js Makefile
+report "run the gio-cat.js example"
+
+echo "1..$total"


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