sv2v/test/lib/runner.sh

31 lines
450 B
Bash
Raw Normal View History

#!/bin/bash
SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"`
2019-09-02 18:54:32 +02:00
tests=`ls *.sv | sed -e "s_\.sv\\\$__"`
2019-10-03 05:26:48 +02:00
if [ $1 ]; then
tests=$1
2019-09-02 18:54:32 +02:00
shift
2019-10-03 05:26:48 +02:00
if [ ! -f $tests.sv ]; then
echo "Could not find $tests.sv"
exit 1
fi
2019-09-02 18:54:32 +02:00
fi
addTest() {
2019-10-03 05:26:48 +02:00
test=$1
2019-09-02 18:54:32 +02:00
eval "test_$test() { runTest \"$test\"; }"
2019-10-03 05:26:48 +02:00
suite_addTest test_$test
2019-09-02 18:54:32 +02:00
}
suite() {
2019-09-02 18:54:32 +02:00
for test in $tests; do
addTest $test
done
}
2019-10-03 05:26:48 +02:00
source $SCRIPT_DIR/functions.sh
. shunit2