From c073f8720161930ecd3f80174b93aa62b63834a4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 29 May 2013 22:52:57 -0600 Subject: 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. --- Makefile | 2 +- test/runtests | 23 ----------------------- test/testenv | 23 +++++++++++++++++++++++ 3 files changed, 24 insertions(+), 24 deletions(-) delete mode 100755 test/runtests create mode 100755 test/testenv diff --git a/Makefile b/Makefile index 928878b..efea3d2 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ all: PHONY build build: PHONY build-libretools build-doc install: PHONY install-libretools install-doc check: - @cd test && ./runtests + @cd test && ./testenv roundup %-doc: PHONY doc $(MAKE) -C doc $* diff --git a/test/runtests b/test/runtests deleted file mode 100755 index 7410032..0000000 --- a/test/runtests +++ /dev/null @@ -1,23 +0,0 @@ -#!/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 -roundup -ret=$? - -# Clean up -rm -rf -- "$destdir" "$testhome" -exit $ret 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 -- cgit v1.2.2