summaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-26 20:33:19 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-26 20:33:19 -0600
commit75b0f765acdaf6571a723b8933ad584b980d08d4 (patch)
tree9853ed63cb4834770ea857f85706b26e37136d92 /test.sh
parentd5960ffb93b701d6dfaff412d9ed12d9bbf2338b (diff)
Update test file for Typecheck negative examples
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