summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2022-05-05 09:22:04 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2022-05-10 09:52:04 +1000
commit1b7d64565cda276dbd20e0b67a9bb88ef538a7f3 (patch)
tree34c8c65fba451cbb59f19c4b3ff294e11c5964f6
parent09567517939109cbaf9928a36e43e86bd1d71082 (diff)
downloadxf86-input-wacom-1b7d64565cda276dbd20e0b67a9bb88ef538a7f3.tar.gz
test: add a helper script to set up the environment
$ sudo ./test/wacom-test-env.sh $ pytest A lot easier this way than having to manually set the environment variables. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Aaron Skomra <aaron.skomra@wacom.com>
-rw-r--r--test/Makefile.am1
-rwxr-xr-xtest/wacom-test-env.sh23
2 files changed, 24 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 5401af0..a9e74f6 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -23,4 +23,5 @@ EXTRA_DIST= \
conftest.py \
test_wacom.py \
devices/wacom-pth660.yml \
+ wacom-test-env.sh \
$(NULL)
diff --git a/test/wacom-test-env.sh b/test/wacom-test-env.sh
new file mode 100755
index 0000000..98eb628
--- /dev/null
+++ b/test/wacom-test-env.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Wrapper to set up the right environment variables and start a nested
+# shell. Usage:
+#
+# $ sudo ./test/wacom-test-env.sh
+# (nested shell) $ pytest
+# (nested shell) $ exit
+
+builddir=$(find $PWD -name meson-logs -printf "%h" -quit)
+
+if [ -z "$builddir" ]; then
+ echo "Unable to find meson builddir"
+ exit 1
+fi
+
+echo "Using meson builddir: $builddir"
+
+export LD_LIBRARY_PATH="$builddir:$LD_LIBRARY_PATH"
+export GI_TYPELIB_PATH="$builddir:$GI_TYPELIB_PATH"
+
+# Don't think this is portable, but oh well
+${SHELL}