author | Christian Urban <urbanc@in.tum.de> |
Sat, 16 Jun 2018 00:07:32 +0100 | |
changeset 182 | d3d912d7e17f |
parent 125 | dcaab8068baa |
permissions | -rwxr-xr-x |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
#!/bin/bash |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
set -e |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
out=${1:-output} |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
echo "" > $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
echo "Below is the feedback and provisional mark for your submission" >> $out |
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
9 |
echo "for CW 8, Part 1. Please note all marks are provisional until" >> $out |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
echo "ratified by the assessment board -- this is not an official" >> $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
echo "results transcript." >> $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
echo "" >> $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
function scala_vars { |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
15 |
(egrep '\bvar\b|\breturn\b|ListBuffer|mutable' "$1" 2> /dev/null 1> /dev/null) |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |
} |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
17 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
18 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
19 |
# compilation tests |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
20 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
21 |
function scala_compile { |
125 | 22 |
(ulimit -t 1 ; scala "$1" 1> $out 2> $out) |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
23 |
} |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
24 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
25 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
26 |
# functional tests |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
27 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
28 |
function scala_assert { |
125 | 29 |
(ulimit - t 1; scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null) |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
30 |
} |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
31 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
32 |
|
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
33 |
# marks for CW |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
34 |
marks=$(( 0 )) |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
35 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
36 |
|
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
37 |
# var, return, ListBuffer test |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
38 |
# |
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
39 |
echo "re.scala does not contain vars, returns etc?" | tee -a $out |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
40 |
|
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
41 |
if (scala_vars re.scala) |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
42 |
then |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
43 |
echo " --> fail" | tee -a $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
44 |
tsts0=$(( 1 )) |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
45 |
else |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
46 |
echo " --> yes" | tee -a $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
47 |
tsts0=$(( 0 )) |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
48 |
fi |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
49 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
50 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
51 |
# compilation test |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
52 |
if [ $tsts0 -eq 0 ] |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
53 |
then |
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
54 |
echo "re.scala runs?" | tee -a $out |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
55 |
|
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
56 |
if (scala_compile re.scala.bak) |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
57 |
then |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
58 |
echo " --> yes" | tee -a $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
59 |
tsts1=$(( 0 )) |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
60 |
else |
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
61 |
echo " --> scala re.scala did not run successfully" | tee -a $out |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
62 |
tsts1=$(( 1 )) |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
63 |
fi |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
64 |
else |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
65 |
tsts1=$(( 1 )) |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
66 |
fi |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
67 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
68 |
if [ $tsts1 -eq 0 ] |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
69 |
then |
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
70 |
echo " nullable(ZERO) == false" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
71 |
echo " nullable(ONE) == true" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
72 |
echo " nullable(CHAR('a')) == false" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
73 |
echo " nullable(ZERO | ONE) == true" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
74 |
echo " nullable(ZERO | CHAR('a')) == false" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
75 |
echo " nullable(ONE ~ ONE) == true" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
76 |
echo " nullable(ONE ~ CHAR('a')) == false" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
77 |
echo " nullable(STAR(ZERO)) == true" | tee -a $out |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
78 |
|
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
79 |
if (scala_assert "re.scala.bak" "../../../marking/re1a_test.scala") |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
80 |
then |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
81 |
echo " --> success" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
82 |
marks=$(( marks + 1 )) |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
83 |
else |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
84 |
echo " --> test failed" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
85 |
fi |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
86 |
fi |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
87 |
|
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
88 |
if [ $tsts1 -eq 0 ] |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
89 |
then |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
90 |
echo " der('a', ZERO | ONE) == (ZERO | ZERO)" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
91 |
echo " der('a', (CHAR('a') | ONE) ~ CHAR('a')) == ALT((ONE | ZERO) ~ CHAR('a'), ONE)" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
92 |
echo " der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a')))" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
93 |
echo " der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a')))" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
94 |
|
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
95 |
if (scala_assert "re.scala.bak" "../../../marking/re1b_test.scala") |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
96 |
then |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
97 |
echo " --> success" | tee -a $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
98 |
marks=$(( marks + 1 )) |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
99 |
else |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
100 |
echo " --> test failed" | tee -a $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
101 |
fi |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
102 |
fi |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
103 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
104 |
if [ $tsts1 -eq 0 ] |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
105 |
then |
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
106 |
echo " simp(ZERO | ONE) == ONE" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
107 |
echo " simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE)" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
108 |
echo " simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a')" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
109 |
echo " simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
110 |
echo " simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a')" | tee -a $out |
91
b43c81c65341
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
90
diff
changeset
|
111 |
echo " simp(CHAR('a') | CHAR('a')) == CHAR('a')" | tee -a $out |
b43c81c65341
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
90
diff
changeset
|
112 |
echo " simp(ONE | CHAR('a')) == (ONE | CHAR('a'))" | tee -a $out |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
113 |
|
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
114 |
if (scala_assert "re.scala.bak" "../../../marking/re1c_test.scala") |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
115 |
then |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
116 |
echo " --> success" | tee -a $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
117 |
marks=$(( marks + 1 )) |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
118 |
else |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
119 |
echo " --> test failed" | tee -a $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
120 |
fi |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
121 |
fi |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
122 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
123 |
if [ $tsts1 -eq 0 ] |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
124 |
then |
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
125 |
echo " EVIL = (a*)* b" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
126 |
echo " ders(List.fill(5)('a'),EVIL) == SEQ(SEQ(STAR(CHAR('a')),STAR(STAR(CHAR('a')))),CHAR('b'))" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
127 |
echo " ders(List('b'),EVIL) == ONE" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
128 |
echo " ders(List('b','b'),EVIL) == ZERO" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
129 |
echo " matcher(EVIL, \"a\" * 5 ++ \"b\") == true" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
130 |
echo " matcher(EVIL, \"b\") == true" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
131 |
echo " matcher(EVIL, \"bb\") == false" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
132 |
echo " matcher(\"abc\", \"abc\") == true" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
133 |
echo " matcher((\"ab\" | \"a\") ~ (ONE | \"bc\"), \"abc\") == true" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
134 |
echo " matcher(ONE, \"\") == true" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
135 |
echo " matcher(ZERO, \"\") == false" | tee -a $out |
91
b43c81c65341
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
90
diff
changeset
|
136 |
echo " matcher(ONE | CHAR('a'), \"\") == true" | tee -a $out |
b43c81c65341
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
90
diff
changeset
|
137 |
echo " matcher(ONE | CHAR('a'), \"a\") == true" | tee -a $out |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
138 |
|
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
139 |
if (scala_assert "re.scala.bak" "../../../marking/re1d_test.scala") |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
140 |
then |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
141 |
echo " --> success" | tee -a $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
142 |
marks=$(( marks + 1 )) |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
143 |
else |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
144 |
echo " --> test failed" | tee -a $out |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
145 |
fi |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
146 |
fi |
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
147 |
|
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
148 |
if [ $tsts1 -eq 0 ] |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
149 |
then |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
150 |
echo " replace(\"aa\".% | \"bb\", \"aabbbaaaaaaabaaaaabbaaaabb\" , \"c\") == \"ccbcabcaccc\"" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
151 |
echo " replace(\"aa\".% | \"bb\", \"abba\" , \"\") == \"aa\"" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
152 |
|
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
153 |
if (scala_assert "re.scala.bak" "../../../marking/re1e_test.scala") |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
154 |
then |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
155 |
echo " --> success" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
156 |
marks=$(( marks + 2 )) |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
157 |
else |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
158 |
echo " --> test failed" | tee -a $out |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
159 |
fi |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
160 |
fi |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
161 |
|
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
162 |
|
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
163 |
## final marks |
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
89
diff
changeset
|
164 |
echo "Overall mark for CW 8, Part 1" | tee -a $out |
89
fac25de665d2
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
165 |
echo "$marks" | tee -a $out |