[Skiboot] [PATCH] external/test: Display test dir on failure

Oliver O'Halloran oohall at gmail.com
Tue Nov 28 18:01:27 AEDT 2017


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 <oohall at gmail.com>
---
 external/test/test.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/external/test/test.sh b/external/test/test.sh
index c3bbc61c197d..7a60c93280a7 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
-- 
2.9.5



More information about the Skiboot mailing list