Add a single generated env file to the test suite
[babeltrace.git] / tests / utils / utils.sh
index afdc856bf12ad07881ac962a679ad2226a4ef3f7..9d9b639b4278965a9779c42372066c7a2982d4a8 100644 (file)
@@ -58,12 +58,11 @@ if [ "x${BT_TESTS_BUILDDIR:-}" = "x" ]; then
 fi
 export BT_TESTS_BUILDDIR
 
-# By default, it will not source tap.sh.  If you to tap output directly from
-# the test script, define the 'SH_TAP' variable to '1' before sourcing this
-# script.
-if [ "x${SH_TAP:-}" = x1 ]; then
-       # shellcheck source=./tap/tap.sh
-       . "${BT_TESTS_SRCDIR}/utils/tap/tap.sh"
+
+# Source the generated environment file if it's present.
+if [ -f "${BT_TESTS_BUILDDIR}/utils/env.sh" ]; then
+       # shellcheck source=./env.sh
+       . "${BT_TESTS_BUILDDIR}/utils/env.sh"
 fi
 
 # Allow overriding the babeltrace2 executables
@@ -82,15 +81,18 @@ BT_PLUGINS_PATH="${BT_TESTS_BUILDDIR}/../src/plugins"
 if [ "x${BT_TESTS_BABELTRACE_PLUGIN_PATH:-}" = "x" ]; then
        BT_TESTS_BABELTRACE_PLUGIN_PATH="${BT_PLUGINS_PATH}/ctf:${BT_PLUGINS_PATH}/utils:${BT_PLUGINS_PATH}/text:${BT_PLUGINS_PATH}/lttng-utils"
 fi
+export BT_TESTS_BABELTRACE_PLUGIN_PATH
 
 if [ "x${BT_TESTS_PROVIDER_DIR:-}" = "x" ]; then
        BT_TESTS_PROVIDER_DIR="${BT_TESTS_BUILDDIR}/../src/python-plugin-provider/.libs"
 fi
+export BT_TESTS_PROVIDER_DIR
 
 # Allow overriding the babeltrace2 executables
 if [ "x${BT_TESTS_PYTHONPATH:-}" = "x" ]; then
        BT_TESTS_PYTHONPATH="${BT_TESTS_BUILDDIR}/../src/bindings/python/bt2/build/build_lib"
 fi
+export BT_TESTS_PYTHONPATH
 
 
 ### External Tools ###
@@ -124,6 +126,15 @@ export BT_TESTS_SED_BIN
 BT_TESTS_DATADIR="${BT_TESTS_SRCDIR}/data"
 BT_CTF_TRACES_PATH="${BT_TESTS_DATADIR}/ctf-traces"
 
+# By default, it will not source tap.sh.  If you want to output tap directly
+# from the test script, define the 'SH_TAP' variable to '1' before sourcing
+# this script.
+if [ "x${SH_TAP:-}" = x1 ]; then
+       # shellcheck source=./tap/tap.sh
+       . "${BT_TESTS_SRCDIR}/utils/tap/tap.sh"
+fi
+
+
 # Remove CR characters in file "$1".
 
 bt_remove_cr() {
This page took 0.023219 seconds and 4 git commands to generate.