1
1

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>
(cherry picked from commit e8277d9d06)
Этот коммит содержится в:
Jeff Squyres 2020-06-17 10:23:13 -07:00
родитель f334a699b7
Коммит 2779a6a96b

Просмотреть файл

@ -1,26 +1,39 @@
#!/bin/sh #!/bin/sh
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
retval=-1 retval=-1
argv=$*
progname="`basename $*`" set $*
while shift; do
if test "$1" = "--test-name"; then
progname=`basename $2`
break
fi
done
echo "--> Testing $progname" echo "--> Testing $progname"
for threads in 1 2 4 5 8 ; do for threads in 1 2 4 5 8 ; do
$* $threads $argv $threads
result=$? result=$?
if test "$result" = "0" ; then if test "$result" = "0" ; then
echo " - $threads threads: Passed" echo " - $threads threads: Passed"
if test "$retval" = "-1" ; then if test $retval -eq -1 ; then
retval=0 retval=0
fi fi
elif test "$result" = "77" ; then elif test "$result" = "77" ; then
echo " - $threads threads: Skipped" echo " - $threads threads: Skipped"
if test "$retval" = "-1" ; then if test $retval -eq -1 ; then
retval=77 retval=77
fi fi
else else
echo " - $threads threads: Failed" echo " - $threads threads: Failed"
retval="$result" retval=$result
fi fi
done done