summaryrefslogtreecommitdiff
path: root/test/testenv
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-05-29 22:52:57 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-05 19:44:27 -0600
commitc073f8720161930ecd3f80174b93aa62b63834a4 (patch)
treea8b9c58d5ef98d1b93dd0804a115fcb4eff2b323 /test/testenv
parenta0a11867a85d5694a24de22751d8db7f59c1f347 (diff)
test/{runtests => testenv}: make it easy to enter a test shell
Move 'runtests' to 'testenv', and have it execute the arguments instead of roundup. Have Makefile pass it 'roundup' as an argument.
Diffstat (limited to 'test/testenv')
-rwxr-xr-xtest/testenv23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/testenv b/test/testenv
new file mode 100755
index 0000000..131eed2
--- /dev/null
+++ b/test/testenv
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# Set up the install to work with
+destdir=$(mktemp --tmpdir -d libretools-test-destdir.XXXXXXXXXX)
+make -C .. install DESTDIR=$destdir &>/dev/null || {
+ echo 'error creating local install, cannot run tests'
+ exit 1
+}
+export PATH="$destdir/usr/bin:$destdir/usr/sbin:$PATH"
+export LIBRETOOLS_LIBDIR="$destdir/usr/lib/libretools"
+
+# Set up the user profile
+home=$(mktemp --tmpdir -d libretools-test-home.XXXXXXXXXX)
+export XDG_CACHE_HOME="$home/.cache"
+export XDG_CONFIG_HOME="$home/.config"
+
+# Run the tests
+eval "$@"
+ret=$?
+
+# Clean up
+rm -rf -- "$destdir" "$testhome"
+exit $ret