updated
authorChristian Urban <urbanc@in.tum.de>
Sat, 02 Feb 2019 13:28:05 +0000
changeset 261 8997430d9765
parent 260 b4812c877b05
child 262 21c69dc3dbf7
updated
marking1/collatz_test.sh
marking1/drumb_test.sh
marking1/drumb_test2.sh
marking1/drumb_test4.scala
marking1/drumb_test7.scala
marking1/mk-advanced
marking2/danube_test.sh
testing1/collatz_test.sh
testing1/drumb_test.sh
testing2/danube_test.sh
testing2/docdiff_test.sh
testing3/knight1_test.sh
testing5/bf_test.sh
--- a/marking1/collatz_test.sh	Sat Feb 02 01:21:43 2019 +0000
+++ b/marking1/collatz_test.sh	Sat Feb 02 13:28:05 2019 +0000
@@ -23,13 +23,13 @@
 # compilation tests
 
 function scala_compile {
-  (ulimit -t 60; JAVA_OPTS="-Xmx1g" scala "$1" 2> /dev/null 1> /dev/null)
+  (ulimit -t 60; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2> /dev/null 1> /dev/null)
 }
 
 # functional tests
 
 function scala_assert {
-  (ulimit -t 60; JAVA_OPTS="-Xmx1g" scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
+  (ulimit -t 60; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
 }
 
 # purity test
--- a/marking1/drumb_test.sh	Sat Feb 02 01:21:43 2019 +0000
+++ b/marking1/drumb_test.sh	Sat Feb 02 13:28:05 2019 +0000
@@ -17,13 +17,13 @@
 # compilation tests
 
 function scala_compile {
-    (ulimit -t 60; JAVA_OPTS="-Xmx1g" scala "$1" 2> /dev/null 1> /dev/null)
+    (ulimit -t 60; JAVA_OPTS="-Xmx1g" scala -nc  "$1" 2> /dev/null 1> /dev/null)
 }
 
 # functional tests
 
 function scala_assert {
-    (ulimit -t 60; JAVA_OPTS="-Xmx4g" scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
+    (ulimit -t 60; JAVA_OPTS="-Xmx4g" scala -nc -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
 }
 
 
--- a/marking1/drumb_test2.sh	Sat Feb 02 01:21:43 2019 +0000
+++ b/marking1/drumb_test2.sh	Sat Feb 02 13:28:05 2019 +0000
@@ -4,6 +4,8 @@
 
 out=${1:-output}
 
+echo "" > $out
+
 echo "Below is the feedback and provisional marks for your submission" >> $out
 echo "for assignment 6 Advanced Part 3.  Please note all marks are provisional until" >> $out
 echo "ratified by the assessment board -- this is not an official" >> $out
@@ -23,7 +25,7 @@
 # functional tests
 
 function scala_assert {
-    (ulimit -t 30; JAVA_OPTS="-Xmx4g" scala -i -nc "$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)
 }
 
 
@@ -72,9 +74,9 @@
 if [ $tsts -eq 0 ]
 then
   echo "  get_delta(None, None) == None" | tee -a $out
-  echo "  get_delta(Some(100.0), None) == None" | tee -a $out
-  echo "  get_delta(None, Some(50.0)) == None" | tee -a $out
-  echo "  get_delta(Some(100.0), Some(50.0)) == Some(1.0)" | tee -a $out
+  echo "  get_delta(Some(50.0), None) == None" | tee -a $out
+  echo "  get_delta(None, Some(100.0)) == None" | tee -a $out
+  echo "  get_delta(Some(50.0), Some(100.0)) == Some(1.0)" | tee -a $out
 
   if (scala_assert "drumb.scala" "drumb_test4.scala")
   then
@@ -100,7 +102,7 @@
   
   if (scala_assert "drumb.scala" "drumb_test5.scala") 
   then
-     echo -e "  --> success" | tee -a $out
+     echo "  --> success" | tee -a $out
      marks=$(( marks + 1 ))
   else
      echo "  --> test failed" | tee -a $out
@@ -113,12 +115,12 @@
 if [ $tsts -eq 0 ]
 then
   echo -e "  val ds = get_deltas(get_prices(List(\"GOOG\", \"AAPL\"), 2010 to 2012))" | tee -a $out
-  echo -e "  yearly_yield(get_deltas(ds, 100, 0) == 125" | tee -a $out
-  echo -e "  yearly_yield(get_deltas(ds, 100, 1) == 117" | tee -a $out
+  echo -e "  yearly_yield(get_deltas(ds, 100, 0)) == 125" | tee -a $out
+  echo -e "  yearly_yield(get_deltas(ds, 100, 1)) == 117" | tee -a $out
   
   if (scala_assert "drumb.scala" "drumb_test6.scala") 
   then
-      echo -e "  --> success" | tee -a $out
+      echo "  --> success" | tee -a $out
       marks=$(( marks + 1 ))
   else
       echo "  --> test failed" | tee -a $out
@@ -138,13 +140,14 @@
   echo -e "  investment(List(\"GOOG\", \"AAPL\", \"BIDU\"), 2000 to 2005, 100) == 113"   | tee -a $out
   echo -e "  investment(List(\"GOOG\", \"AAPL\", \"BIDU\"), 2000 to 2006, 100) == 254"   | tee -a $out
   echo -e "  investment(List(\"GOOG\", \"AAPL\", \"BIDU\"), 2000 to 2007, 100) == 349"   | tee -a $out
+  echo -e "  investment(List(\"GOOG\", \"AAPL\", \"BIDU\"), 1990 to 2017, 100) == 83061"   | tee -a $out
   
   if (scala_assert "drumb.scala" "drumb_test7.scala") 
   then
-      echo -e "  --> success" | tee -a $out
-      marks=$(( marks + 1 ))
+    echo "  --> success" | tee -a $out
+    marks=$(( marks + 1 ))
   else
-      echo "  --> test failed" | tee -a $out
+    echo "  --> test failed" | tee -a $out
   fi
 fi
 
--- a/marking1/drumb_test4.scala	Sat Feb 02 01:21:43 2019 +0000
+++ b/marking1/drumb_test4.scala	Sat Feb 02 13:28:05 2019 +0000
@@ -1,6 +1,6 @@
 
 
 assert(get_delta(None, None) == None)
-assert(get_delta(Some(100.0), None) == None)
-assert(get_delta(None, Some(50.0)) == None)
-assert(get_delta(Some(100.0), Some(50.0)) == Some(1.0))
+assert(get_delta(Some(50.0), None) == None)
+assert(get_delta(None, Some(100.0)) == None)
+assert(get_delta(Some(50.0), Some(100.0)) == Some(1.0))
--- a/marking1/drumb_test7.scala	Sat Feb 02 01:21:43 2019 +0000
+++ b/marking1/drumb_test7.scala	Sat Feb 02 13:28:05 2019 +0000
@@ -7,3 +7,4 @@
 assert(investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2005, 100) == 113)
 assert(investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2006, 100) == 254)
 assert(investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2007, 100) == 349)
+assert(investment(List("GOOG", "AAPL", "BIDU"), 1990 to 2017, 100) == 83061)
--- a/marking1/mk-advanced	Sat Feb 02 01:21:43 2019 +0000
+++ b/marking1/mk-advanced	Sat Feb 02 13:28:05 2019 +0000
@@ -3,7 +3,7 @@
 
 trap "exit" INT
 
-files=${1:-assignment20186A-*}
+files=${1:-assignment20186-*}
 
 for sd in $files; do
   cd $sd
--- a/marking2/danube_test.sh	Sat Feb 02 01:21:43 2019 +0000
+++ b/marking2/danube_test.sh	Sat Feb 02 13:28:05 2019 +0000
@@ -15,13 +15,13 @@
 # compilation tests
 
 function scala_compile {
-  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out) 
+  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2>> $out 1>> $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
--- a/testing1/collatz_test.sh	Sat Feb 02 01:21:43 2019 +0000
+++ b/testing1/collatz_test.sh	Sat Feb 02 13:28:05 2019 +0000
@@ -15,13 +15,13 @@
 # compilation tests
 
 function scala_compile {
-  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out) 
+  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2>> $out 1>> $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
--- a/testing1/drumb_test.sh	Sat Feb 02 01:21:43 2019 +0000
+++ b/testing1/drumb_test.sh	Sat Feb 02 13:28:05 2019 +0000
@@ -11,13 +11,13 @@
 # compilation tests
 
 function scala_compile {
-  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out) 
+  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2>> $out 1>> $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
--- a/testing2/danube_test.sh	Sat Feb 02 01:21:43 2019 +0000
+++ b/testing2/danube_test.sh	Sat Feb 02 13:28:05 2019 +0000
@@ -15,13 +15,13 @@
 # compilation tests
 
 function scala_compile {
-  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out) 
+  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2>> $out 1>> $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
--- a/testing2/docdiff_test.sh	Sat Feb 02 01:21:43 2019 +0000
+++ b/testing2/docdiff_test.sh	Sat Feb 02 13:28:05 2019 +0000
@@ -15,13 +15,13 @@
 # compilation tests
 
 function scala_compile {
-  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out) 
+  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2>> $out 1>> $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
--- a/testing3/knight1_test.sh	Sat Feb 02 01:21:43 2019 +0000
+++ b/testing3/knight1_test.sh	Sat Feb 02 13:28:05 2019 +0000
@@ -12,17 +12,17 @@
 # compilation tests
 
 function scala_compile {
-  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out) 
+  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2>> $out 1>> $out) 
 }
 
 # functional tests
 
 function scala_assert_slow {
-  (ulimit -t 120; JAVA_OPTS="-Xmx1g" scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
+  (ulimit -t 120; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
 }
 
 function scala_assert_thirty {
-  (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)
 }
 
 function scala_assert_quick {
--- a/testing5/bf_test.sh	Sat Feb 02 01:21:43 2019 +0000
+++ b/testing5/bf_test.sh	Sat Feb 02 13:28:05 2019 +0000
@@ -12,7 +12,7 @@
 # compilation tests
 
 function scala_compile {
-   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out)
+   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2>> $out 1>> $out)
 }
 
 # functional tests