aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2021-06-02 06:46:47 -0500
committerRob Landley <rob@landley.net>2021-06-02 06:46:47 -0500
commitde474ba0395024e4149ae8be61097dec6b91cf07 (patch)
tree9ff27b93ed3de5b86619a1c1cfa447ae8222a64a
parentb93f5908e2f0932620e5120fb52a942fa5573cf9 (diff)
downloadtoybox-de474ba0395024e4149ae8be61097dec6b91cf07.tar.gz
Fix "make tests" exiting on failure when test run in subshell.
-rwxr-xr-xscripts/test.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/test.sh b/scripts/test.sh
index daaeec07..a217ef0c 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -31,7 +31,8 @@ export LC_COLLATE=C
do_test()
{
- cd "$TESTDIR" && rm -rf testdir && mkdir testdir && cd testdir || exit 1
+ cd "$TESTDIR" && rm -rf testdir continue && mkdir testdir && cd testdir ||
+ exit 1
CMDNAME="${1##*/}"
CMDNAME="${CMDNAME%.test}"
if [ -z "$TEST_HOST" ]
@@ -44,7 +45,9 @@ do_test()
fi
C="$(dirname $(realpath "$C"))/$CMDNAME"
- (. "$1")
+ (. "$1"; cd "$TESTDIR"; touch continue)
+ cd "$TESTDIR"
+ [ -e continue ] || exit 1
}
if [ $# -ne 0 ]