From 336c44adca1768ada1e1e2f4d7dbbc33e994e582 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 2 Mar 2016 15:20:04 -0600 Subject: Factor out command name at the start of test name, have runtest.sh print it. --- scripts/test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/test.sh') diff --git a/scripts/test.sh b/scripts/test.sh index 2276619e..0c3d7aaf 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -29,12 +29,15 @@ if [ $# -ne 0 ] then for i in "$@" do + CMDNAME="${i##*/}" + CMDNAME="${CMDNAME%.test}" . "$TOPDIR"/tests/$i.test done else for i in "$TOPDIR"/tests/*.test do - CMDNAME="$(echo "$i" | sed 's@.*/\(.*\)\.test@\1@')" + CMDNAME="${i##*/}" + CMDNAME="${CMDNAME%.test}" if [ -h ../$CMDNAME ] || [ ! -z "$TEST_HOST" ] then cd .. && rm -rf testdir && mkdir testdir && cd testdir || exit 1 -- cgit v1.2.3