Commit fbde7aac by Zachary Snow

faster test runner pattern matching

parent 801955ff
...@@ -56,16 +56,22 @@ assertConverts() { ...@@ -56,16 +56,22 @@ assertConverts() {
assertTrue "conversion of $ac_file not stable after the first iteration" $? assertTrue "conversion of $ac_file not stable after the first iteration" $?
$SV2V -v $ac_file 2> /dev/null > /dev/null $SV2V -v $ac_file 2> /dev/null > /dev/null
assertTrue "verbose conversion of $ac_file failed" $? assertTrue "verbose conversion of $ac_file failed" $?
# using sed to remove quoted strings # using sed to remove quoted strings and integer unsigned
filtered=`sed -E 's/"([^"]|\")+"//g' $ac_tmpa` filtered=`sed -E -e 's/"([^"]|\")+"//g' -e 's/integer unsigned/integer/g' $ac_tmpa`
# check for various things iverilog accepts which we don't want to output # check for various things iverilog accepts which we don't want to output
PATTERNS="\$bits\|\$dimensions\|\$unpacked_dimensions\|\$left\|\$right\|\$low\|\$high\|\$increment\|\$size" prefix="conversion of $ac_file still contains"
echo "$filtered" | grep "$PATTERNS" > /dev/null assertNotMatch "$filtered" "$prefix dimension queries" \
assertFalse "conversion of $ac_file still contains dimension queries" $? '\$bits|\$dimensions|\$unpacked_dimensions|\$left|\$right|\$low|\$high|\$increment|\$size'
echo "$filtered" | egrep "\s(int\|bit\|logic\|byte\|struct\|enum\|longint\|shortint)\s" assertNotMatch "$filtered" "$prefix SystemVerilog types" \
assertFalse "conversion of $ac_file still contains SV types" $? '[[:space:]](int|bit|logic|byte|struct|enum|longint|shortint)[[:space:]]'
echo "$filtered" | grep "[^\$a-zA-Z_]unsigned" | grep -v "integer unsigned" > /dev/null assertNotMatch "$filtered" "$prefix unsigned keyword" \
assertFalse "conversion of $ac_file still contains unsigned keyword" $? '[^\$a-zA-Z_]unsigned'
}
assertNotMatch() {
if [[ "$1" =~ $3 ]]; then
fail "$2"
fi
} }
# convert SystemVerilog source file(s) # convert SystemVerilog source file(s)
......
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