marking4/postfix_test.sh
author Christian Urban <urbanc@in.tum.de>
Tue, 22 Jan 2019 12:53:05 +0000
changeset 258 ebe71908b13e
parent 257 ba4d976ca88d
child 288 65731df141a5
permissions -rwxr-xr-x
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
257
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
#!/bin/bash
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
set -euo pipefail
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
out=${1:-output}
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
echo -e "" > $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
echo "Below is the feedback and provisional marks for your submission" >> $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
echo "for assignment 9 Part 2.  Please note all marks are provisional until" >> $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
echo "ratified by the assessment board -- this is not an official" >> $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
echo "results transcript." >> $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
echo "" >> $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
# marks for CW9 part 2
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
marks=$(( 0 ))
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
# compilation tests
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
function scala_compile {
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2>> $out 1>> $out)   
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
}
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
# functional tests
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
function scala_assert {
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null) 
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
}
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
# purity test
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
function scala_vars {
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
   (egrep '\bvar\b|\breturn\b|\.par|ListBuffer|mutable|new Array' "$1" 2> /dev/null 1> /dev/null)
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
}
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
# var, return, ListBuffer test
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
#
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
echo -e "postfix.scala does not contain vars, returns, Arrays, ListBuffers etc?" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
if (scala_vars postfix.scala)
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
then
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
  echo "  --> test failed" | tee -a $out  
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
  tsts0=$(( 1 ))
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
else
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
  echo "  --> success" | tee -a $out  
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
  tsts0=$(( 0 )) 
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
# compilation test
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
if  [ $tsts0 -eq 0 ]
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
then    
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  echo "postfix.scala runs?" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
258
ebe71908b13e updated
Christian Urban <urbanc@in.tum.de>
parents: 257
diff changeset
    57
  if (scala_compile postfix.scala)
257
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
  then
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
    echo "  --> success" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
    tsts1=$(( 0 ))
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
  else
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
    echo "  --> scala postfix.scala did not run successfully" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
    tsts1=$(( 1 )) 
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
  fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
else
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
  tsts1=$(( 1 ))     
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
### postfix tests
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
if [ $tsts1 -eq 0 ]
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
then
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
  echo -e " syard(split(\"3 + 4 * ( 2 - 1 )\")) == List(\"3\", \"4\", \"2\", \"1\", \"-\", \"*\", \"+\")" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
  echo -e " syard(split(\"( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )\")) == List(\"3\", \"4\", \"5\", \"+\", \"+\")" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
  echo -e " syard(split(\"5 + 7 / 2\")) == List(\"5\", \"7\", \"2\", \"/\", \"+\")" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
  echo -e " syard(split(\"5 * 7 / 2\")) == List(\"5\", \"7\", \"*\", \"2\", \"/\")" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
  
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
  if (scala_assert "postfix.scala" "postfix_test7.scala")
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
  then
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
    echo -e "  --> success" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
    marks=$(( marks + 1 ))
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
  else
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
    echo -e "  --> test failed" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
  fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
if [ $tsts1 -eq 0 ]
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
then
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
  echo -e " compute(syard(split(\"3 + 4 * ( 2 - 1 )\"))) == 7" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
  echo -e " compute(syard(split(\"10 + 12 * 33\"))) == 406" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
  echo -e " compute(syard(split(\"( 5 + 7 ) * 2\"))) == 24" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
  echo -e " compute(syard(split(\"5 + 7 / 2\"))) == 8" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
  echo -e " compute(syard(split(\"5 * 7 / 2\"))) == 17" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  echo -e " compute(syard(split(\"9 + 24 / ( 7 - 3 )\"))) == 15" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
  
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
  if (scala_assert "postfix.scala" "postfix_test8.scala")
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
  then
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
     echo -e "  --> success" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
     marks=$(( marks + 1 ))
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
  else
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
     echo "  --> test failed" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
  fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
### postfix2 tests
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
# var, return, ListBuffer test
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
#
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
echo -e "postfix2.scala does not contain vars, returns, Arrays, ListBuffers etc?" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
if (scala_vars postfix2.scala)
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
then
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
  echo "  --> test failed" | tee -a $out  
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
  tsts0=$(( 1 ))
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
else
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
  echo "  --> success" | tee -a $out  
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
  tsts0=$(( 0 )) 
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
# compilation test
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
# compilation test
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
if  [ $tsts0 -eq 0 ]
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
then    
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
  echo "postfix2.scala runs?" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
258
ebe71908b13e updated
Christian Urban <urbanc@in.tum.de>
parents: 257
diff changeset
   133
  if (scala_compile postfix2.scala)
257
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
  then
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
    echo "  --> success" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
    tsts1=$(( 0 ))
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
  else
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
    echo "  --> scala postfix2.scala did not run successfully" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
    tsts1=$(( 1 )) 
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
  fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
else
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
  tsts1=$(( 1 ))     
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
if [ $tsts1 -eq 0 ]
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
then
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
  echo -e " syard(split(\"3 + 4 * ( 2 - 1 )\")) == List(\"3\", \"4\", \"2\", \"1\", \"-\", \"*\", \"+\")" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
  echo -e " syard(split(\"( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )\")) == List(\"3\", \"4\", \"5\", \"+\", \"+\")" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
  echo -e " syard(split(\"5 + 7 / 2\")) == List(\"5\", \"7\", \"2\", \"/\", \"+\")" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
  echo -e " syard(split(\"5 * 7 / 2\")) == List(\"5\", \"7\", \"*\", \"2\", \"/\")" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
  echo -e " syard(split(\"3 + 4 * 8 / ( 5 - 1 ) ^ 2 ^ 3\")) == " | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   153
  echo -e "         List(\"3\", \"4\", \"8\", \"*\", \"5\", \"1\", \"-\", \"2\", \"3\", \"^\", \"^\", \"/\", \"+\")" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
  echo -e " " | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
  echo -e " compute(syard(split(\"3 + 4 * ( 2 - 1 )\"))) == 7" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
  echo -e " compute(syard(split(\"10 + 12 * 33\"))) == 406" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
  echo -e " compute(syard(split(\"( 5 + 7 ) * 2\"))) == 24" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
  echo -e " compute(syard(split(\"5 + 7 / 2\"))) == 8" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
  echo -e " compute(syard(split(\"5 * 7 / 2\"))) == 17" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
  echo -e " compute(syard(split(\"9 + 24 / ( 7 - 3 )\"))) == 15" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
  echo -e " compute(syard(split(\"4 ^ 3 ^ 2\"))) == 262144" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
  echo -e " compute(syard(split(\"4 ^ ( 3 ^ 2 )\"))) == 262144" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
  echo -e " compute(syard(split(\"( 4 ^ 3 ) ^ 2\"))) == 4096" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
  echo -e " compute(syard(split(\"( 3 + 1 ) ^ 2 ^ 3\"))) == 65536" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
  
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
  if (scala_assert "postfix2.scala" "postfix_test9.scala")
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
  then
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
      echo -e "  --> success" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
      marks=$(( marks + 2 ))
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
  else
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
      echo "  --> test failed" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
  fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
fi
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
## final marks
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
echo "Overall mark for CW 9, Part 2" | tee -a $out
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
echo "$marks" | tee -a $out