-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·35 lines (30 loc) · 778 Bytes
/
Copy pathtest.sh
File metadata and controls
executable file
·35 lines (30 loc) · 778 Bytes
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
#!/bin/sh
########################################
##### regression test for codeRunner
########################################
PROG="./bin/codeRunner"
ARGS="--no-prompt --no-readline"
CASES_DIR="./test/cases"
EXPECTED_DIR="./test/expected"
OUTPUT_DIR="./test/output"
numCases=0
numCasesOk=0
numCasesFailed=0
for case in `ls ./test/cases`
do
echo -n "test $case ... "
numCases=`expr $numCases + 1`
name=`basename $case .c`
cat $CASES_DIR/$case | $PROG $ARGS > $OUTPUT_DIR/$name.out
diff $OUTPUT_DIR/$name.out $EXPECTED_DIR/$name.out
if [ $? -eq 0 ] ; then
echo "ok !"
numCasesOk=`expr $numCasesOk + 1`
else
echo "failed!"
numCasesFailed=`expr $numCasesFailed + 1`
fi
done
echo "total: $numCases"
echo "passed: $numCasesOk"
echo "failed: $numCasesFailed"