-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·58 lines (48 loc) · 2 KB
/
test.sh
File metadata and controls
executable file
·58 lines (48 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Set Normal CLASSPATH
export CLASSPATH=$(pwd)/bin/
export CLASSPATH=$CLASSPATH:$(pwd)/lib/*
# Set CLASSPATH for prog1 solution
# This is if you are using my prog1 solution
export CLASSPATH=$CLASSPATH:$(pwd)/.solution/prog1/*
# Clean up previous build
make clean
mkdir -p ./Parse/antlr_build/Parse
# Generate ANTLR files
java -jar ./lib/antlr-4.13.2-complete.jar \
-visitor Parse/gParser.g4 \
-o ./Parse/antlr_build \
-lib ./Parse/antlr_build/Parse/ -lib ./.solution/prog1/
# Compile the project
find . -name "*.java" > sources.txt
javac -d bin @sources.txt
rm sources.txt
# Run your project on 100 test files
testfiles=($(find ./tests/ -type f))
echo "################################################################################" > report.txt
for testfile in "${testfiles[@]}"; do
# Generate report
echo "################################################################################" >> report.txt
cat $testfile >> report.txt
echo "" >> report.txt
echo "" >> report.txt
echo $testfile >> report.txt
# Print all results to report.txt
java Parse.ParserDriver $testfile >> report.txt 2>&1
done
# Run solution on 100 test files
testfiles=($(find ./tests/ -type f))
echo "################################################################################" > solution_report.txt
for testfile in "${testfiles[@]}"; do
# Generate report
echo "################################################################################" >> solution_report.txt
cat $testfile >> solution_report.txt
echo "" >> solution_report.txt
echo "" >> solution_report.txt
echo $testfile >> solution_report.txt
# Print all results to solution_report.txt
java -cp .solution/prog2/prog2.jar:.solution/prog1/*:lib/* \
Parse.ParserDriver $testfile \
>> solution_report.txt 2>&1
done
diff -u report.txt solution_report.txt >> final_report.txt