mirror of https://github.com/zachjs/sv2v.git
add error test suite
This commit is contained in:
parent
b58cf5bf07
commit
5ed053d317
|
|
@ -0,0 +1,8 @@
|
|||
module top;
|
||||
typedef enum {
|
||||
A = 0,
|
||||
B, // implicitly 1
|
||||
C = 1
|
||||
} Enum;
|
||||
Enum e;
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module top;
|
||||
wire (highz0, highz1) x;
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#!/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
|
||||
|
|
@ -0,0 +1 @@
|
|||
`endif
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
#!/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
|
||||
|
|
|
|||
Loading…
Reference in New Issue