marking2/danube_test.sh
author Christian Urban <urbanc@in.tum.de>
Wed, 30 Oct 2019 14:21:16 +0000
changeset 289 08b5ddbc7e55
parent 284 9a04eb6a2291
child 331 e3878cdd38bc
permissions -rwxr-xr-x
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
#!/bin/bash
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
# to make the script fail safely
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
set -euo pipefail
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
out=${1:-output}
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
     9
264
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
    10
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    11
echo -e  "" > $out
264
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
    12
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    13
echo -e  "Below is the feedback and provisional marks for your submission" >> $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    14
echo -e  "for core assignment 7.  Please note all marks are provisional until" >> $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    15
echo -e  "ratified by the assessment board -- this is not an official" >> $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    16
echo -e  "results transcript." >> $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    17
echo -e  "" >> $out
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    19
echo -e  "Below is the feedback for your submission danube.scala" >> $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    20
echo -e  "" >> $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    21
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    22
# marks for core CW7
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    23
marks=$(( 0 ))
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
# compilation tests
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
function scala_compile {
283
ef5f62bf5987 updated
Christian Urban <urbanc@in.tum.de>
parents: 264
diff changeset
    29
    (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out)
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
}
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
# functional tests
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
function scala_assert {
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    35
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" 2> /dev/null 1> /dev/null)
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
}
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
# purity test
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
function scala_vars {
264
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
    41
   (egrep '\bvar\b|\breturn\b|ListBuffer|mutable' "$1" 2> /dev/null 1> /dev/null)
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
}
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
# var, .par return, ListBuffer test
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
#
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    47
echo -e  "danube.scala does not contain vars, returns etc?" | tee -a $out
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
if (scala_vars danube.scala)
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
then
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    51
  echo -e  "  --> test failed" | tee -a $out
264
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
    52
  tsts0=$(( 1 ))  
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
else
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    54
  echo -e  "  --> success" | tee -a $out
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  tsts0=$(( 0 )) 
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
fi
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
### compilation test
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
if  [ $tsts0 -eq 0 ]
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
then 
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    63
  echo -e  "danube.scala runs?" | tee -a $out
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
  if (scala_compile danube.scala)
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
  then
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    67
    echo -e  "  --> success" | tee -a $out
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
    tsts=$(( 0 ))
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
  else
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    70
    echo -e  "  --> SCALA DID NOT RUN danube.scala" | tee -a $out
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
    tsts=$(( 1 )) 
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
  fi
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
else
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
  tsts=$(( 1 ))     
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
fi
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
### danube get_cvs_url tests
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
if [ $tsts -eq 0 ]
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
then
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    81
  echo -e  "danube.scala tests:" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    82
  echo -e  "  val movies_url = \"\"\"https://nms.kcl.ac.uk/christian.urban/movies.csv\"\"\"" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    83
  echo -e  "  get_csv_url(movies_url).length == 9742" | tee -a $out
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
  if (scala_assert "danube.scala" "danube_test1.scala")
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
  then
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    87
      echo -e  "  --> success" | tee -a $out
264
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
    88
      marks=$(( marks + 1 ))
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
  else
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    90
    echo -e  "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
  fi
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
fi
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
### danube processing tests
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
if [ $tsts -eq 0 ]
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
then
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    98
  echo -e  "  val good_ratings = process_ratings(ratings)" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    99
  echo -e  "  val movie_names = process_movies(movies)" | tee -a $out  
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   100
  echo -e  "  " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   101
  echo -e  "  good_ratings.length == 48580 " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   102
  echo -e  "  movie_names.length == 9742 " | tee -a $out
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
  if (scala_assert "danube.scala" "danube_test2.scala") 
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
  then
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   106
      echo -e  "  --> success" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   107
      marks=$(( marks + 1 ))
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   108
  else
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   109
    echo -e  "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   110
  fi
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   111
fi
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   112
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   113
### danube groupById test
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   114
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   115
if [ $tsts -eq 0 ]
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   116
then
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   117
  echo -e  "  val ls1 = List((\"1\", \"a\"), (\"2\", \"a\"), (\"1\", \"c\"), (\"2\", \"a\"), (\"1\", \"c\"))" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   118
  echo -e  "  val ls2 = List((\"1\", \"a\"), (\"1\", \"b\"), (\"2\", \"x\"), (\"3\", \"a\"), (\"2\", \"y\"), (\"3\", \"c\"))" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   119
  echo -e  "  groupById(ls1, Map()) == Map(1 -> List(c, c, a), 2 -> List(a, a))" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   120
  echo -e  "  groupById(ls2, Map()) == Map(1 -> List(b, a), 2 -> List(x, y), 3 -> List(c, a))" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   121
  echo -e  "      where the order in the lists is unimportant" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   122
  echo -e  "  val ls3 = (1 to 1000).map(_.toString).toList" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   123
  echo -e  "  val ls4 = ls3 zip ls3.tail" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   124
  echo -e  "  val ls5 = ls4 ::: ls4.reverse" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   125
  echo -e  "  groupById(ls5, Map()) == Map(1 -> List(2,2), 2 -> List(3,3), ....)" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   126
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   127
  if (scala_assert "danube.scala" "danube_test3.scala")
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   128
  then
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   129
      echo -e  -e "  --> success" | tee -a $out
264
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
   130
      marks=$(( marks + 1 ))
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
  else
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   132
      echo -e  -e "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   133
  fi
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   134
fi
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   135
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   136
### danube favourites tests
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   137
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   138
if [ $tsts -eq 0 ]
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   139
then
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   140
  echo -e  "  val good_ratings = process_ratings(ratings)" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   141
  echo -e  "  val ratings_map = groupById(good_ratings, Map())" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   142
  echo -e  "  favourites(ratings_map, \"912\").length  == 80 " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   143
  echo -e  "  favourites(ratings_map, \"858\").length  == 158 " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   144
  echo -e  "  favourites(ratings_map, \"260\").length  == 201 " | tee -a $out  
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   145
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   146
  if (scala_assert "danube.scala" "danube_test4.scala") 
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   147
  then
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   148
    echo -e  "  --> success" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   149
    marks=$(( marks + 1 ))
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   150
  else
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   151
    echo -e  "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   152
  fi
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   153
fi
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   154
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   155
### danube suggestions tests
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   156
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   157
if [ $tsts -eq 0 ]
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   158
then
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   159
  echo -e  "  val good_ratings = process_ratings(ratings)" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   160
  echo -e  "  val ratings_map = groupById(good_ratings, Map())" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   161
  echo -e  "  suggestions(ratings_map, \"912\").length  == 4110 " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   162
  echo -e  "  suggestions(ratings_map, \"858\").length  == 4883 " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   163
  echo -e  "  suggestions(ratings_map, \"260\").length  == 4970 " | tee -a $out  
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   164
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   165
  if (scala_assert "danube.scala" "danube_test5.scala") 
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   166
  then
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   167
    echo -e  "  --> success" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   168
    marks=$(( marks + 1 ))
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   169
  else
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   170
    echo -e  "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   171
  fi
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   172
fi
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   173
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   174
### danube recommendation tests
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   175
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   176
if [ $tsts -eq 0 ]
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   177
then
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   178
  echo -e  "  recommendations(ratings_map, movies_map, \"1\").length  == 2 " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   179
  echo -e  "  recommendations(ratings_map, movies_map, \"2\").length  == 2 " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   180
  echo -e  "  recommendations(ratings_map, movies_map, \"3\").length  == 2 " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   181
  echo -e  "  recommendations(ratings_map, movies_map, \"4\").length  == 0 " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   182
  echo -e  "  recommendations(ratings_map, movies_map, \"5\").length  == 2 " | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   183
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   184
  if (scala_assert "danube.scala" "danube_test6.scala") 
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   185
  then
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   186
    echo -e  "  --> success" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   187
    marks=$(( marks + 1 ))
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   188
  else
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   189
    echo -e  "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
  fi
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   191
fi
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
264
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
   193
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
   194
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
   195
## final marks
284
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   196
echo -e  "Overall mark for CW 7 Core Part" | tee -a $out
9a04eb6a2291 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
   197
echo -e  "$marks" | tee -a $out
264
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
   198
ecd989eee8bd updated
Christian Urban <urbanc@in.tum.de>
parents: 261
diff changeset
   199