test runner supports explicit list of tests

This commit is contained in:
Zachary Snow 2020-02-15 17:34:21 -05:00
parent 799141af42
commit 29b5136503
1 changed files with 10 additions and 8 deletions

View File

@ -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
}