From afe10960c138295dfeb79f55d79abc5167a126a7 Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Tue, 28 Nov 2017 18:01:27 +1100 Subject: external/test: Display test dir on failure Print some information about the failing test rather than forcing the user to go dig it up. Also move the stdout and stderr files into the test directory to make the relevant stdout/stderr files easier to locate. Signed-off-by: Oliver O'Halloran Signed-off-by: Stewart Smith --- external/test/test.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'external/test/test.sh') diff --git a/external/test/test.sh b/external/test/test.sh index c3bbc61c..7a60c932 100755 --- a/external/test/test.sh +++ b/external/test/test.sh @@ -27,6 +27,10 @@ run_binary() { fail_test() { echo "$0 ($CUR_TEST): test failed"; + echo "Test directory preserved:" + echo " DATA_DIR = $DATA_DIR" + echo " STDOUT = $STDOUT_OUT" + echo " STDERR = $STDERR_OUT" exit ${1:-1}; } @@ -76,9 +80,9 @@ run_tests() { exit 1; fi - export STDERR_OUT=$(mktemp --tmpdir external-test-stderr.XXXXXX); - export STDOUT_OUT=$(mktemp --tmpdir external-test-stdout.XXXXXX); export DATA_DIR=$(mktemp --tmpdir -d external-test-datadir.XXXXXX); + export STDERR_OUT="$DATA_DIR/stderr" + export STDOUT_OUT="$DATA_DIR/stdout" if [ $# -eq 3 ] ; then cp -r $3/* "$DATA_DIR" fi -- cgit v1.2.1