Commit 5ed053d3 by Zachary Snow

add error test suite

parent b58cf5bf
module top;
typedef enum {
A = 0,
B, // implicitly 1
C = 1
} Enum;
Enum e;
endmodule
module top;
wire (highz0, highz1) x;
endmodule
#!/bin/bash
addTest() {
test=$1
eval "test_$test() { \
$SV2V $test.sv 2> /dev/null > /dev/null; \
assertFalse \"conversion should have failed\" \$?; \
}"
suite_addTest test_$test
}
source ../lib/discover.sh
. shunit2
#!/bin/bash
tests=(`basename -s .sv *.sv`)
if [ $1 ]; then
tests=(`basename -s .sv "$@"`)
shift ${#tests[@]}
fi
suite() {
for test in "${tests[@]}"; do
if [ ! -f $test.sv ]; then
echo "Could not find $test.sv"
exit 1
fi
addTest $test
done
}
......@@ -2,31 +2,13 @@
SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"`
tests=(`ls *.sv | sed -e "s_\.sv\\\$__"`)
if [ $1 ]; then
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() {
test=$1
eval "test_$test() { runTest \"$test\"; }"
suite_addTest test_$test
}
suite() {
for test in "${tests[@]}"; do
addTest $test
done
}
source $SCRIPT_DIR/functions.sh
source $SCRIPT_DIR/discover.sh
. shunit2
......@@ -6,10 +6,6 @@ test_main() {
simulateAndCompare "reference.v" "$cv" "$SCRIPT_DIR/empty.v"
}
suite() {
suite_addTest "test_main"
}
source ../lib/functions.sh
. shunit2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment