From 29b51365033393071d4ee26d5c93365dd6c4e594 Mon Sep 17 00:00:00 2001 From: Zachary Snow Date: Sat, 15 Feb 2020 17:34:21 -0500 Subject: [PATCH] test runner supports explicit list of tests --- test/lib/runner.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/lib/runner.sh b/test/lib/runner.sh index d67ffb6..b235ca3 100644 --- a/test/lib/runner.sh +++ b/test/lib/runner.sh @@ -2,15 +2,17 @@ SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"` -tests=`ls *.sv | sed -e "s_\.sv\\\$__"` +tests=(`ls *.sv | sed -e "s_\.sv\\\$__"`) if [ $1 ]; then - tests=$1 - shift - if [ ! -f $tests.sv ]; then - echo "Could not find $tests.sv" - exit 1 - fi + tests=("$@") + shift ${#tests[@]} + for test in $tests; do + if [ ! -f $test.sv ]; then + echo "Could not find $test.sv" + exit 1 + fi + done fi addTest() { @@ -20,7 +22,7 @@ addTest() { } suite() { - for test in $tests; do + for test in "${tests[@]}"; do addTest $test done }