diff -r c493eaba6018 -r 65731df141a5 marking4/postfix_test.sh --- a/marking4/postfix_test.sh Wed Oct 30 12:47:10 2019 +0000 +++ b/marking4/postfix_test.sh Wed Oct 30 14:07:58 2019 +0000 @@ -7,11 +7,11 @@ echo -e "" > $out -echo "Below is the feedback and provisional marks for your submission" >> $out -echo "for assignment 9 Part 2. Please note all marks are provisional until" >> $out -echo "ratified by the assessment board -- this is not an official" >> $out -echo "results transcript." >> $out -echo "" >> $out +echo -e "Below is the feedback and provisional marks for your submission" >> $out +echo -e "the preliminary part for assignment 9. 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 CW9 part 2 marks=$(( 0 )) @@ -20,13 +20,13 @@ # compilation tests function scala_compile { - (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2>> $out 1>> $out) + (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out) } # functional tests function scala_assert { - (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null) + (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2") #2> /dev/null 1> /dev/null) } # purity test @@ -42,24 +42,24 @@ if (scala_vars postfix.scala) then - echo " --> test failed" | tee -a $out + echo -e " --> FAIL (make triple-sure your program conforms to the required format)\n" | tee -a $out tsts0=$(( 1 )) else - echo " --> success" | tee -a $out + echo -e " --> success" | tee -a $out tsts0=$(( 0 )) fi # compilation test if [ $tsts0 -eq 0 ] then - echo "postfix.scala runs?" | tee -a $out + echo -e "postfix.scala runs?" | tee -a $out if (scala_compile postfix.scala) then - echo " --> success" | tee -a $out + echo -e " --> success" | tee -a $out tsts1=$(( 0 )) else - echo " --> scala postfix.scala did not run successfully" | tee -a $out + echo -e " --> SCALA DID NOT RUN postfix.scala" | tee -a $out tsts1=$(( 1 )) fi else @@ -81,7 +81,7 @@ echo -e " --> success" | tee -a $out marks=$(( marks + 1 )) else - echo -e " --> test failed" | tee -a $out + echo -e " --> ONE OF THE TESTS FAILED\n" | tee -a $out fi fi @@ -101,7 +101,7 @@ echo -e " --> success" | tee -a $out marks=$(( marks + 1 )) else - echo " --> test failed" | tee -a $out + echo " --> ONE OF THE TESTS FAILED\n" | tee -a $out fi fi @@ -115,10 +115,10 @@ if (scala_vars postfix2.scala) then - echo " --> test failed" | tee -a $out + echo -e " --> FAIL (make triple-sure your program conforms to the required format)\n" | tee -a $out tsts0=$(( 1 )) else - echo " --> success" | tee -a $out + echo -e " --> success" | tee -a $out tsts0=$(( 0 )) fi @@ -128,14 +128,14 @@ # compilation test if [ $tsts0 -eq 0 ] then - echo "postfix2.scala runs?" | tee -a $out + echo -e "postfix2.scala runs?" | tee -a $out if (scala_compile postfix2.scala) then - echo " --> success" | tee -a $out + echo -e " --> success" | tee -a $out tsts1=$(( 0 )) else - echo " --> scala postfix2.scala did not run successfully" | tee -a $out + echo -e " --> SCALA DID NOT RUN postfix2.scala" | tee -a $out tsts1=$(( 1 )) fi else @@ -168,10 +168,10 @@ echo -e " --> success" | tee -a $out marks=$(( marks + 2 )) else - echo " --> test failed" | tee -a $out + echo -e " --> ONE OF THE TESTS FAILED\n" | tee -a $out fi fi ## final marks -echo "Overall mark for CW 9, Part 2" | tee -a $out -echo "$marks" | tee -a $out +echo -e "Overall mark for CW 9, Preliminary Part" | tee -a $out +echo -e "$marks" | tee -a $out