-
Notifications
You must be signed in to change notification settings - Fork 0
/
Grading_Script_Step4.sh
57 lines (52 loc) · 1.31 KB
/
Grading_Script_Step4.sh
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
#!/bin/sh
INPUTS=inputs/*
mkdir usertest
for i in $INPUTS
do
filename=${i%.*}
name=${filename##*/}
echo "Generating code for input file $i"
output="${name}Test.out"
./Micro $i > usertest/$output
done
OUTPUTS=outputs/*
mkdir outtest
g++ -o tiny tinyNew.C
for j in $OUTPUTS
do
filename=${j%.*}
name=${filename##*/}
echo "Expected output generated for $j"
output2="${name}Test_o.out"
if [[ $j == *"step4_testcase"* ]]
then
echo 2 4 25 17 6 32 1 4 15 4 | ./tiny $j > outtest/$output2
elif [[ $j == *"test_mult"* ]]
then
echo 3 2 | ./tiny $j > outtest/$output2
else
./tiny $j > outtest/$output2
fi
done
# Checking your outputs
USERTEST=usertest/*
mkdir userout
#g++ -o tiny tinyNew.C
for j in $USERTEST
do
filename=${j%.*}
name=${filename##*/}
echo -e "\n\n***Testing output of $j***"
output2="${name}_out.out"
outtest="${name}_o.out"
if [[ $j == *"step4_testcase"* ]]
then
echo 2 4 25 17 6 32 1 4 15 4 | ./tiny $j > userout/$output2
elif [[ $j == *"test_mult"* ]]
then
echo 3 2 | ./tiny $j > userout/$output2
else
./tiny $j > userout/$output2
fi
diff -y -B -b userout/$output2 outtest/$outtest
done