Skip to content

Commit e8277d9

Browse files
committed
tests/asm/run_tests: fix basename usage
Looks like this script was left over from quite a long time ago, and was expecting CLI params from the "old"-style Automake test engine. Update it to look for `--test-name` to get the test name, and update a few other minor style things. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent fcdcb59 commit e8277d9

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

test/asm/run_tests

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
11
#!/bin/sh
2+
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
3+
# $COPYRIGHT$
4+
#
5+
# Additional copyrights may follow
6+
#
7+
# $HEADER$
28

39
retval=-1
10+
argv=$*
411

5-
progname="`basename $*`"
12+
set $*
13+
while shift; do
14+
if test "$1" = "--test-name"; then
15+
progname=`basename $2`
16+
break
17+
fi
18+
done
619
echo "--> Testing $progname"
720

821
for threads in 1 2 4 5 8 ; do
9-
$* $threads
22+
$argv $threads
1023
result=$?
1124
if test "$result" = "0" ; then
1225
echo " - $threads threads: Passed"
13-
if test "$retval" = "-1" ; then
26+
if test $retval -eq -1 ; then
1427
retval=0
1528
fi
1629
elif test "$result" = "77" ; then
1730
echo " - $threads threads: Skipped"
18-
if test "$retval" = "-1" ; then
31+
if test $retval -eq -1 ; then
1932
retval=77
2033
fi
2134
else
2235
echo " - $threads threads: Failed"
23-
retval="$result"
36+
retval=$result
2437
fi
2538
done
2639

0 commit comments

Comments
 (0)