diff --git a/src/run-js-test.c b/src/run-js-test.c index 41fb37c18..c89d26fd5 100644 --- a/src/run-js-test.c +++ b/src/run-js-test.c @@ -32,18 +32,17 @@ #include #include +#include #include #include #include "shell-global.h" #include "shell-global-private.h" -static char **include_path = NULL; static char *command = NULL; static GOptionEntry entries[] = { { "command", 'c', 0, G_OPTION_ARG_STRING, &command, "Program passed in as a string", "COMMAND" }, - { "include-path", 'I', 0, G_OPTION_ARG_STRING_ARRAY, &include_path, "Add the directory DIR to the list of directories to search for js files.", "DIR" }, { NULL } }; @@ -131,6 +130,14 @@ main(int argc, char **argv) clutter_stage_set_title (CLUTTER_STAGE (stage), title); g_free (title); +#if HAVE_BLUETOOTH + /* The module imports are all so intertwined that if the test + * imports anything in js/ui, it will probably eventually end up + * pulling in ui/status/bluetooth.js. So we need this. + */ + g_irepository_prepend_search_path (BLUETOOTH_DIR); +#endif + /* evaluate the script */ error = NULL; if (!gjs_context_eval (js_context, script, len, diff --git a/tests/Makefile.am b/tests/Makefile.am index 172dc998a..fe3ff565a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -28,6 +28,7 @@ EXTRA_DIST += $(TEST_MISC) run-test.sh: run-test.sh.in $(AM_V_GEN) sed \ -e "s|@MUTTER_TYPELIB_DIR[@]|$(MUTTER_TYPELIB_DIR)|" \ + -e "s|@JHBUILD_TYPELIBDIR[@]|$(JHBUILD_TYPELIBDIR)|" \ -e "s|@srcdir[@]|$(srcdir)|" \ $< > $@ && chmod a+x $@ diff --git a/tests/run-test.sh.in b/tests/run-test.sh.in index ee1472fed..0a0147310 100755 --- a/tests/run-test.sh.in +++ b/tests/run-test.sh.in @@ -30,7 +30,7 @@ builddir=`cd $builddir && pwd` srcdir=$builddir/@srcdir@ srcdir=`cd $srcdir && pwd` -GI_TYPELIB_PATH="@MUTTER_TYPELIB_DIR@:$builddir/../src" +GI_TYPELIB_PATH="$GI_TYPELIB_PATH${GI_TYPELIB_PATH:+:}@MUTTER_TYPELIB_DIR@:@JHBUILD_TYPELIBDIR@:$builddir/../src" GJS_PATH="$srcdir:$srcdir/../js" GJS_DEBUG_OUTPUT=stderr $verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG"