diff options
Diffstat (limited to 'test.sh')
-rwxr-xr-x | test.sh | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,37 @@ +#!/bin/sh + +################################################## +# A test script that uses ./runner.sh to run all # +# tests for a given phase. # +################################################## + +testdir="./output" +case "$1" in + "typecheck") + ext="java" + ;; + "boil") + ext="java" + ;; + "vaporize") + ext="vapor" + ;; + "condense") + ext="vaporm" + ;; + *) + echo "usage $0 [java|typecheck|boil|vaporize|condense]" + exit 1 + ;; +esac + +echo "$testdir/*.$ext" + +for file in $testdir/*.$ext; do + [ -f "$file" ] || break + base=${file%.*} + echo -n "Processing file: $base " + expected=$(bash runner.sh java "${base}.java") + actual=$(bash runner.sh $1 $file 2>/dev/null) + [[ $expected == $actual ]] && echo 'PASSED' || echo -e "FAILED" +done |