d8d7f5f711
js/ui/environment.js: Split out initial UI setup (Tweener initialization, Nbtk monkey-patching) into a separate file we can import from tests. tests/: Directory for various types of tests tests/run-test.sh: Shell script that to run tests with an appropriate environment set up. tests/testcommon/: Common modules and data for tests tests/interactive/: Interactive tests tests/interactive/box-layout.js: A sample test of NbtkLayout
45 lines
863 B
Bash
45 lines
863 B
Bash
#!/bin/sh
|
|
|
|
usage() {
|
|
echo >&2 "Usage run-test.sh [-v|--verbose] <test_js>..."
|
|
exit 1
|
|
}
|
|
|
|
tests=
|
|
verbose=false
|
|
for arg in $@ ; do
|
|
case $arg in
|
|
-v|--verbose)
|
|
verbose=true
|
|
;;
|
|
-*)
|
|
usage
|
|
;;
|
|
*)
|
|
tests="$tests $arg"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
builddir=`dirname $0`
|
|
builddir=`cd $builddir && pwd`
|
|
srcdir=$builddir/@srcdir@
|
|
srcdir=`cd $srcdir && pwd`
|
|
|
|
GI_TYPELIB_PATH="$builddir/../src"
|
|
GJS_DEBUG_OUTPUT=stderr
|
|
$verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
|
|
GNOME_SHELL_TESTSDIR="$srcdir/"
|
|
LD_PRELOAD="$builddir/../src/.libs/libgnome-shell.so"
|
|
|
|
export GI_TYPELIB_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_JS GNOME_SHELL_TESTSDIR LD_PRELOAD
|
|
|
|
gjs_args=
|
|
for i in $srcdir $srcdir/../js @GJS_JS_DIR@ @GJS_JS_NATIVE_DIR@ ; do
|
|
gjs_args="$gjs_args -I $i"
|
|
done
|
|
|
|
for test in $tests ; do
|
|
gjs-console $gjs_args $test || exit $?
|
|
done
|