diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-26 19:36:16 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-26 19:36:16 -0600 |
commit | e2d7b563cd22b92604e07dad9bf6bcf0393a46ca (patch) | |
tree | 539f081c254d31afe9574fa42f5629971d8a9eb5 /test.sh | |
parent | 42512ab2cfd16422909263475b044f40b3829707 (diff) |
HeatVisitor MessageSend anonymous, observe Factorial + others pass
Diffstat (limited to 'test.sh')
-rwxr-xr-x | test.sh | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -5,19 +5,32 @@ # tests for a given phase. # ################################################## +function java() { + expected=$(bash runner.sh java "$1.java") +} + +function match() { + [[ "$1" == *"error"* ]] && expected="Type error" || + expected="Program type checked successfully" +} + testdir="./output" case "$1" in "heat") ext="java" + comp="match" ;; "boil") ext="java" + comp="java" ;; "vaporize") ext="vapor" + comp="java" ;; "condense") ext="vaporm" + comp="java" ;; *) echo "usage $0 [heat|boil|vaporize|condense]" @@ -31,7 +44,7 @@ for file in $testdir/*.$ext; do [ -f "$file" ] || break base=${file%.*} echo -n "Processing file: $base " - expected=$(bash runner.sh java "${base}.java") + $comp $base actual=$(bash runner.sh $1 $file 2>/dev/null) [[ $expected == $actual ]] && echo 'PASSED' || echo -e "FAILED" done |