run-test.sh.in 1 KB
Newer Older
1 2 3 4 5 6 7 8 9
#!/bin/sh

usage() {
    echo >&2 "Usage run-test.sh [-v|--verbose] <test_js>..."
    exit 1
}

tests=
verbose=false
10
debug=
11 12
for arg in $@ ; do
    case $arg in
13
	-g|--debug)
14
	    debug="libtool --mode=execute gdb --args"
15
	    ;;
16 17 18 19 20 21 22 23 24 25 26 27 28 29
	-v|--verbose)
	    verbose=true
	    ;;
	-*)
	    usage
	    ;;
	*)
	    tests="$tests $arg"
	    ;;
    esac
done

builddir=`dirname $0`
builddir=`cd $builddir && pwd`
30
srcdir=@srcdir@
31 32
srcdir=`cd $srcdir && pwd`

33
GI_TYPELIB_PATH="$GI_TYPELIB_PATH${GI_TYPELIB_PATH:+:}@MUTTER_TYPELIB_DIR@:$builddir/../src:$builddir/../src/st:$builddir/../subprojects/gvc"
34
GJS_PATH="$srcdir:$srcdir/../js:$builddir/../js"
35 36 37
GJS_DEBUG_OUTPUT=stderr
$verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
GNOME_SHELL_TESTSDIR="$srcdir/"
38
GNOME_SHELL_JS="$srcdir/../js"
39
GNOME_SHELL_DATADIR="$builddir/../data"
40

41
export GI_TYPELIB_PATH GJS_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_TESTSDIR GNOME_SHELL_JS GNOME_SHELL_DATADIR LD_PRELOAD
42 43

for test in $tests ; do
44
    $debug $builddir/../src/run-js-test $test || exit $?
45
done