summaryrefslogtreecommitdiffstats
path: root/tests/run-test.sh.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:54:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:54:43 +0000
commite4283f6d48b98e764b988b43bbc86b9d52e6ec94 (patch)
treec8f7f7a6c2f5faa2942d27cefc6fd46cca492656 /tests/run-test.sh.in
parentInitial commit. (diff)
downloadgnome-shell-e4283f6d48b98e764b988b43bbc86b9d52e6ec94.tar.xz
gnome-shell-e4283f6d48b98e764b988b43bbc86b9d52e6ec94.zip
Adding upstream version 43.9.upstream/43.9upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xtests/run-test.sh.in45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/run-test.sh.in b/tests/run-test.sh.in
new file mode 100755
index 0000000..ea6d157
--- /dev/null
+++ b/tests/run-test.sh.in
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+usage() {
+ echo >&2 "Usage run-test.sh [-v|--verbose] <test_js>..."
+ exit 1
+}
+
+tests=
+verbose=false
+debug=
+for arg in $@ ; do
+ case $arg in
+ -g|--debug)
+ debug="libtool --mode=execute gdb --args"
+ ;;
+ -v|--verbose)
+ verbose=true
+ ;;
+ -*)
+ usage
+ ;;
+ *)
+ tests="$tests $arg"
+ ;;
+ esac
+done
+
+builddir=`dirname $0`
+builddir=`cd $builddir && pwd`
+srcdir=@srcdir@
+srcdir=`cd $srcdir && pwd`
+
+GI_TYPELIB_PATH="$GI_TYPELIB_PATH${GI_TYPELIB_PATH:+:}@MUTTER_TYPELIB_DIR@:$builddir/../src:$builddir/../src/st:$builddir/../subprojects/gvc"
+GJS_PATH="$srcdir:$srcdir/../js:$builddir/../js"
+GJS_DEBUG_OUTPUT=stderr
+$verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
+GNOME_SHELL_TESTSDIR="$srcdir/"
+GNOME_SHELL_JS="$srcdir/../js"
+GNOME_SHELL_DATADIR="$builddir/../data"
+
+export GI_TYPELIB_PATH GJS_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_TESTSDIR GNOME_SHELL_JS GNOME_SHELL_DATADIR LD_PRELOAD
+
+for test in $tests ; do
+ $debug $builddir/../src/run-js-test $test || exit $?
+done