diff -r 9bb36426c781 -r a359976a6f3e marking3/knight1_test.sh --- a/marking3/knight1_test.sh Sun Dec 09 01:36:49 2018 +0000 +++ b/marking3/knight1_test.sh Mon Dec 10 02:23:30 2018 +0000 @@ -31,6 +31,15 @@ (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null) } +function scala_assert_long { + (ulimit -t 60; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null) +} + +function scala_assert_elong { + (ulimit -t 90; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null) +} + + # purity test function scala_vars { @@ -115,12 +124,12 @@ then echo " all_tours from every position on the board" | tee -a $out echo " dim = 1: 1" | tee -a $out - echo " 2: 0,0,0,0" >> $out - echo " 3: 0,0,0,0,0,0,0,0,0" >> $out + echo " 2: 0,0,0,0" | tee -a $out + echo " 3: 0,0,0,0,0,0,0,0,0" | tee -a $out echo " 4: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" | tee -a $out echo " 5: 304,0,56,0,304,0,56,0,56,0,56,0,64,0,56,0,56,0,56,0,304,0,56,0,304" | tee -a $out - if (scala_assert "knight1.scala" "knight1_test3a.scala") + if (time scala_assert_elong "knight1.scala" "knight1_test3a.scala") then echo " --> success" | tee -a $out marks=$(( marks + 1 )) @@ -133,7 +142,7 @@ then echo " enum_tours(5, List((0,2)) ) => 56 tours? and all correct?" | tee -a $out - if (scala_assert "knight1.scala" "knight1_test3b.scala") + if (time scala_assert "knight1.scala" "knight1_test3b.scala") then echo " --> success" | tee -a $out marks=$(( marks + 1 )) @@ -143,7 +152,7 @@ fi -### knight2a test +### knight4 test if [ $tsts1 -eq 0 ] then @@ -161,17 +170,17 @@ fi -### knight2b test +### knight5 test if [ $tsts1 -eq 0 ] then echo " is first_tour(8, List((0, 0))) ok? " | tee -a $out echo " is first_tour(4, List((0, 0))) == None " | tee -a $out - if (scala_assert "knight1.scala" "knight5_test.scala") + if (time scala_assert_long "knight1.scala" "knight1_test5.scala") then echo " --> success" | tee -a $out - marks=$(( marks + 2 )) + marks=$(( marks + 1 )) else echo " --> test failed" | tee -a $out fi