summaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh24
1 files changed, 14 insertions, 10 deletions
diff --git a/test.sh b/test.sh
index a27b321..1f8f11e 100755
--- a/test.sh
+++ b/test.sh
@@ -14,11 +14,13 @@ function match() {
expected="Program type checked successfully"
}
-testdir="./output"
+dir1="./output"
+dir2=""
case "$1" in
"heat")
ext="java"
comp="match"
+ dir2="./output/negative"
;;
"boil")
ext="java"
@@ -38,13 +40,15 @@ case "$1" in
;;
esac
-echo "$testdir/*.$ext"
-
-for file in $testdir/*.$ext; do
- [ -f "$file" ] || break
- base=${file%.*}
- echo -n "Processing file: $base "
- $comp $base
- actual=$(bash runner.sh $1 $file 2>/dev/null)
- [[ $expected == $actual ]] && echo 'PASSED' || echo -e "FAILED"
+for dir in "$dir1" "$dir2"; do
+ if [ -n "$dir" ] && [ -d "$dir" ]; then
+ for file in $dir/*.$ext; do
+ [ -f "$file" ] || break
+ base=${file%.*}
+ echo -n "Processing file: $base "
+ $comp $base
+ actual=$(bash runner.sh $1 $file 2>/dev/null)
+ [[ $expected == $actual ]] && echo 'PASSED' || echo -e "FAILED"
+ done
+ fi
done