2009-09-18 19:51:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
usage() {
|
|
|
|
echo >&2 "Usage run-test.sh [-v|--verbose] <test_js>..."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
tests=
|
|
|
|
verbose=false
|
2009-09-20 01:27:01 +00:00
|
|
|
debug=
|
2009-09-18 19:51:15 +00:00
|
|
|
for arg in $@ ; do
|
|
|
|
case $arg in
|
2009-09-20 01:27:01 +00:00
|
|
|
-g|--debug)
|
2010-10-31 19:28:06 +00:00
|
|
|
debug="libtool --mode=execute gdb --args"
|
2009-09-20 01:27:01 +00:00
|
|
|
;;
|
2009-09-18 19:51:15 +00:00
|
|
|
-v|--verbose)
|
|
|
|
verbose=true
|
|
|
|
;;
|
|
|
|
-*)
|
|
|
|
usage
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
tests="$tests $arg"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
builddir=`dirname $0`
|
|
|
|
builddir=`cd $builddir && pwd`
|
|
|
|
srcdir=$builddir/@srcdir@
|
|
|
|
srcdir=`cd $srcdir && pwd`
|
|
|
|
|
2012-08-02 00:02:49 +00:00
|
|
|
GI_TYPELIB_PATH="$GI_TYPELIB_PATH${GI_TYPELIB_PATH:+:}@MUTTER_TYPELIB_DIR@:$builddir/../src"
|
2010-11-20 18:01:43 +00:00
|
|
|
GJS_PATH="$srcdir:$srcdir/../js"
|
2009-09-18 19:51:15 +00:00
|
|
|
GJS_DEBUG_OUTPUT=stderr
|
|
|
|
$verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
|
|
|
|
GNOME_SHELL_TESTSDIR="$srcdir/"
|
2012-12-23 04:04:27 +00:00
|
|
|
GNOME_SHELL_JS="$srcdir/../js"
|
|
|
|
GNOME_SHELL_DATADIR="$srcdir/../data"
|
2009-09-18 19:51:15 +00:00
|
|
|
|
2012-12-23 04:04:27 +00:00
|
|
|
export GI_TYPELIB_PATH GJS_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_TESTSDIR GNOME_SHELL_JS GNOME_SHELL_DATADIR LD_PRELOAD
|
2009-09-18 19:51:15 +00:00
|
|
|
|
|
|
|
for test in $tests ; do
|
2010-11-20 18:01:43 +00:00
|
|
|
$debug $builddir/../src/run-js-test $test || exit $?
|
2009-09-18 19:51:15 +00:00
|
|
|
done
|