pre_testing1/collatz_test.sh
changeset 360 e45d2890749d
parent 356 d1046d9d3213
child 376 6cc36d0ef79e
--- a/pre_testing1/collatz_test.sh	Mon Nov 09 17:49:12 2020 +0000
+++ b/pre_testing1/collatz_test.sh	Sat Nov 14 00:40:47 2020 +0000
@@ -7,7 +7,6 @@
 out=${1:-output}
 
 echo -e "" > $out
-echo -e "" > c$out
 
 echo -e "Below is the feedback for your submission collatz.scala" >> $out
 echo -e "" >> $out
@@ -16,13 +15,13 @@
 # compilation tests
 
 function scala_compile {
-  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -Xprint:parser "$1" 2>> $out 1>> $out)
+  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -Xprint:parser "$1" 2> c$out 1> c$out)
 }
 
 # functional tests
 
 function scala_assert {
-  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" -e "" 2> /dev/null 1> /dev/null)
+  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" -- "$2" -e "" 2> /dev/null 1> /dev/null)
 }
 
 # purity test
@@ -38,7 +37,7 @@
 
 if (scala_compile collatz.scala)
 then
-    echo -e "  --> passed" >> $out
+    echo -e "  --> success" >> $out
     tsts=$(( 0 ))
 else
     echo -e "  --> SCALA DID NOT RUN collatz.scala\n" >> $out
@@ -59,7 +58,7 @@
       echo -e "  --> FAIL (make triple-sure your program conforms to the required format)\n" >> $out
       tsts=$(( 1 ))
    else
-      echo -e "  --> passed" >> $out
+      echo -e "  --> success" >> $out
       tsts=$(( 0 )) 
    fi
 fi