diff -r c3d3461a5e77 -r e3878cdd38bc marking2/danube_test.sh --- a/marking2/danube_test.sh Tue Feb 04 11:20:31 2020 +0000 +++ b/marking2/danube_test.sh Tue Feb 04 14:15:42 2020 +0000 @@ -7,20 +7,22 @@ out=${1:-output} - +echo -e `date` >> $out echo -e "" > $out - echo -e "Below is the feedback and provisional marks for your submission" >> $out echo -e "for core assignment 7. Please note all marks are provisional until" >> $out echo -e "ratified by the assessment board -- this is not an official" >> $out echo -e "results transcript." >> $out echo -e "" >> $out +# marks for core CW7 +marks=$(( 0 )) + +echo -e "" >> $out echo -e "Below is the feedback for your submission danube.scala" >> $out echo -e "" >> $out -# marks for core CW7 -marks=$(( 0 )) + # compilation tests @@ -38,17 +40,17 @@ # purity test function scala_vars { - (egrep '\bvar\b|\breturn\b|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) } # var, .par return, ListBuffer test # -echo -e "danube.scala does not contain vars, returns etc?" | tee -a $out +echo -e "danube.scala does not contain vars, returns, Arrays, ListBuffers etc?" | tee -a $out if (scala_vars danube.scala) then - echo -e " --> test failed" | tee -a $out + echo -e " --> TEST FAILED\n" | tee -a $out tsts0=$(( 1 )) else echo -e " --> success" | tee -a $out @@ -87,7 +89,7 @@ echo -e " --> success" | tee -a $out marks=$(( marks + 1 )) else - echo -e " --> ONE OF THE TESTS FAILED\n" | tee -a $out + echo -e " --> ONE OF THE TESTS FAILED\n" | tee -a $out fi fi @@ -106,7 +108,7 @@ echo -e " --> success" | tee -a $out marks=$(( marks + 1 )) else - echo -e " --> ONE OF THE TESTS FAILED\n" | tee -a $out + echo -e " --> ONE OF THE TESTS FAILED\n" | tee -a $out fi fi @@ -193,6 +195,7 @@ ## final marks +echo -e "" >> $out echo -e "Overall mark for CW 7 Core Part" | tee -a $out echo -e "$marks" | tee -a $out