c98103ffc8
ST makes use of GTK+ for input methods and for icon themes; therefore we have need to initialize GTK+ in order to test these parts of Clutter. Instead of LD_PRELOADING our module, use a separately compiled executable that links to the UI components in GNOME Shell, initializes Clutter and GTK+ and hooks them together. Getting all the symbols from St and the GUI components exported for use via GJS requires a bit of contortion: we need to actually link the St convenience library into a shared library and link the executable to that since there is no way with libtool to take a convenience library and put all its symbols into an executable --whole-archive style. https://bugzilla.gnome.org/show_bug.cgi?id=633657
48 lines
964 B
Bash
48 lines
964 B
Bash
#!/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=$builddir/@srcdir@
|
|
srcdir=`cd $srcdir && pwd`
|
|
|
|
GI_TYPELIB_PATH="@MUTTER_LIB_DIR@/mutter:$builddir/../src"
|
|
GJS_DEBUG_OUTPUT=stderr
|
|
$verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
|
|
GNOME_SHELL_TESTSDIR="$srcdir/"
|
|
|
|
export GI_TYPELIB_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_JS GNOME_SHELL_TESTSDIR LD_PRELOAD
|
|
|
|
run_js_test_args=
|
|
for i in $srcdir $srcdir/../js @GJS_JS_DIR@ @GJS_JS_NATIVE_DIR@ ; do
|
|
run_js_test_args="$run_js_test_args -I $i"
|
|
done
|
|
|
|
for test in $tests ; do
|
|
$debug $builddir/../src/run-js-test $run_js_test_args $test || exit $?
|
|
done
|