Commit 44c2e870 by Zachary Snow

test runner checks for warnings emitted by sv2v

parent 543b4590
...@@ -42,21 +42,20 @@ assertConverts() { ...@@ -42,21 +42,20 @@ assertConverts() {
ac_file=$1 ac_file=$1
ac_tmpa=$SHUNIT_TMPDIR/ac-conv-tmpa.v ac_tmpa=$SHUNIT_TMPDIR/ac-conv-tmpa.v
$SV2V $ac_file 2> /dev/null > $ac_tmpa convert "1st conversion of $ac_file" $ac_tmpa $ac_file
assertTrue "1st conversion of $ac_file failed" $?
ac_tmpb=$SHUNIT_TMPDIR/ac-conv-tmpb.v ac_tmpb=$SHUNIT_TMPDIR/ac-conv-tmpb.v
$SV2V $ac_tmpa 2> /dev/null > $ac_tmpb convert "2nd conversion of $ac_file" $ac_tmpb $ac_tmpa
assertTrue "2nd conversion of $ac_file failed" $?
diff $ac_tmpa $ac_tmpb > /dev/null diff $ac_tmpa $ac_tmpb > /dev/null
assertTrue "conversion of $ac_file not stable after the first iteration" $? assertTrue "conversion of $ac_file not stable after the first iteration" $?
ac_tmpc=$SHUNIT_TMPDIR/ac-conv-tmpc.v ac_tmpc=$SHUNIT_TMPDIR/ac-conv-tmpc.v
$SV2V --pass-through $ac_file 2> /dev/null > $ac_tmpc convert "pass through of $ac_file" $ac_tmpc --pass-through $ac_file
assertTrue "pass through of $ac_file failed" $?
ac_tmpd=$SHUNIT_TMPDIR/ac-conv-tmpd.v ac_tmpd=$SHUNIT_TMPDIR/ac-conv-tmpd.v
$SV2V $ac_tmpc 2> /dev/null > $ac_tmpd convert "conversion of pass through of $ac_file" $ac_tmpd $ac_tmpc
assertTrue "conversion of pass through of $ac_file failed" $?
diff $ac_tmpa $ac_tmpd > /dev/null diff $ac_tmpa $ac_tmpd > /dev/null
assertTrue "pass through then conversion differs for $ac_file" $? assertTrue "pass through then conversion differs for $ac_file" $?
...@@ -80,9 +79,15 @@ assertNotMatch() { ...@@ -80,9 +79,15 @@ assertNotMatch() {
# convert SystemVerilog source file(s) # convert SystemVerilog source file(s)
convert() { convert() {
out_file=$1; shift description=$1
$SV2V "$@" 2> /dev/null > $out_file out_file=$2
assertTrue "conversion failed" $? shift 2
$SV2V "$@" 2> $SHUNIT_TMPDIR/stderr > $out_file
assertTrue "$description failed" $?
if [ -s $SHUNIT_TMPDIR/stderr ]; then
fail "$description emitted warnings:"
cat $SHUNIT_TMPDIR/stderr
fi
} }
simpleTest() { simpleTest() {
...@@ -109,10 +114,10 @@ simpleTest() { ...@@ -109,10 +114,10 @@ simpleTest() {
fi fi
cs=$SHUNIT_TMPDIR/cs.v cs=$SHUNIT_TMPDIR/cs.v
convert $cs $sv convert "standard conversion" $cs $sv
cv=$SHUNIT_TMPDIR/cv.v cv=$SHUNIT_TMPDIR/cv.v
convert $cv $sv -v convert "verbose conversion" $cv $sv -v
simulateAndCompare $ve $cs $cv $tb simulateAndCompare $ve $cs $cv $tb
} }
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
test_default() { test_default() {
cs=$SHUNIT_TMPDIR/cs.v cs=$SHUNIT_TMPDIR/cs.v
cv=$SHUNIT_TMPDIR/cv.v cv=$SHUNIT_TMPDIR/cv.v
convert $cs package.svh module.sv convert "standard conversion" $cs package.svh module.sv
convert $cv package.svh module.sv -v convert "verbose conversion" $cv package.svh module.sv -v
simulateAndCompare reference.v $cs $cv "$SCRIPT_DIR/empty.v" simulateAndCompare reference.v $cs $cv "$SCRIPT_DIR/empty.v"
} }
......
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