--- a/testing2/knight3_test.sh Tue Nov 21 16:31:11 2017 +0000
+++ b/testing2/knight3_test.sh Thu Nov 23 10:56:47 2017 +0000
@@ -15,19 +15,19 @@
# compilation tests
function scala_compile {
- (ulimit -t 30 -m 1024000 ; scala "$1" 2>> $out 1>> $out)
+ (ulimit -t 30 ; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out)
}
# functional tests
function scala_assert {
- (ulimit -t 300 -m 1024000 ; scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
+ (ulimit -t 20 ; JAVA_OPTS="-Xmx1g" scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
}
# purity test
function scala_vars {
- (egrep '\bvar\b|\breturn\b|\.par|ListBuffer|mutable' "$1" 2> /dev/null 1> /dev/null)
+ (egrep '\bvar\b|\breturn\b|\.par|ListBuffer|mutable|new Array' "$1" 2> /dev/null 1> /dev/null)
}
@@ -37,7 +37,7 @@
if (scala_vars knight3.scala)
then
- echo " --> fail" >> $out
+ echo " --> fail: if you do not fix this, you will receive a mark of zero" >> $out
tsts0=$(( 1 ))
else
echo " --> success" >> $out
@@ -66,6 +66,7 @@
if [ $tsts1 -eq 0 ]
then
+ echo "Takes 20 seconds or less to execute: " >> $out
echo " ordered_moves(8, List((3,4), (3,2)), (1, 3)) == List((0,1), (0,5), (2,1), (2,5))" >> $out
echo " ordered_moves(8, List((4,0)), (0,0)) == List((2,1), (1,2))" >> $out
echo " ordered_moves(8, List((0,4)), (0,0)) == List((1,2), (2,1))" >> $out
@@ -97,6 +98,7 @@
if [ $tsts1 -eq 0 ]
then
+ echo "Takes 20 seconds or less to execute: " >> $out
echo " first_tour_heuristic(8, List((0,0))) found and ok?" >> $out
echo " first_tour_heuristic(40, List((0,0))) found and ok?" >> $out