From a657e4e7c9cff967303a0396d7819073d8e17fea Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Mon, 3 Apr 2017 04:21:46 +0000 Subject: make test: tweak helper scripts Change-Id: Iee6016757e45c832e8868f0bdcfd4192dd3380c8 Signed-off-by: Klement Sekera --- test/scripts/git_pull_or_clean.sh | 7 ++++++- test/scripts/test-loop.sh | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'test/scripts') diff --git a/test/scripts/git_pull_or_clean.sh b/test/scripts/git_pull_or_clean.sh index 489091f9..b119a9cc 100755 --- a/test/scripts/git_pull_or_clean.sh +++ b/test/scripts/git_pull_or_clean.sh @@ -1,3 +1,8 @@ #!/bin/sh +CMD='git clean -dfX */' -git pull | grep -q -v 'Already up-to-date.' || git clean -dfX */ +if git pull | grep -v 'Already up-to-date.' +then + echo "Executing $CMD" + $CMD +fi diff --git a/test/scripts/test-loop.sh b/test/scripts/test-loop.sh index 9f228833..17dc7c39 100755 --- a/test/scripts/test-loop.sh +++ b/test/scripts/test-loop.sh @@ -94,7 +94,7 @@ do if [[ "$PRE_EXEC_CMD" != "" ]] then echo "Executing \`$PRE_EXEC_CMD' before test.." - if ! ($PRE_EXEC_CMD 2>$TMP 1>$TMP) + if ! ($PRE_EXEC_CMD 2>&1 | tee $TMP) then echo "\`$PRE_EXEC_CMD' failed!" >&2 REASON="$PRE_EXEC_CMD failed" @@ -102,7 +102,7 @@ do fi fi echo -n "Running test iteration #$COUNT..." - if ! ($CMD 2>$TMP 1>$TMP) + if ! ($CMD >$TMP 2>&1) then AFTER=`date +%s` RUNTIME=$((AFTER-BEFORE)) -- cgit 1.2.3-korg