testing3/testing3-bak/knight1_test.sh
author Christian Urban <urbanc@in.tum.de>
Wed, 16 Jan 2019 12:24:47 +0000
changeset 254 cc0154804096
parent 245 975d34506e88
permissions -rwxr-xr-x
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
#!/bin/bash
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
     2
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
     3
# to make the script fail safely
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
     4
set -euo pipefail
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
out=${1:-output}
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
echo "" > $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    10
echo "Below is the feedback and provisional marks for your submission" >> $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    11
echo "for assignment 7 Part 1.  Please note all marks are provisional until" >> $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    12
echo "ratified by the assessment board -- this is not an official" >> $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    13
echo "results transcript." >> $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    14
echo "" >> $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    15
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    16
echo "Below is the feedback for your submission of CW 7, Part 1." >> $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
echo "" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    20
# marks for CW7 part 1
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    21
marks=$(( 0 ))
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    22
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    23
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    24
# compilation tests (used to be 30 secs)
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
function scala_compile {
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    27
  (ulimit -t 360; JAVA_OPTS="-Xmx1g" scala "$1" 2> /dev/null 1> /dev/null) 
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
}
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
# functional tests
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    32
function scala_assert {
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    33
  (ulimit -t 360; JAVA_OPTS="-Xmx1g" scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
}
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
# purity test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
function scala_vars {
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    39
   (egrep '\bvar\b|\breturn\b|\.par|ListBuffer|mutable|new Array' "$1" 2> /dev/null 1> /dev/null)
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
}
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
# knights1: purity test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    45
echo "knight1.scala does not contain vars, returns, Arrays, ListBuffers etc?" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
if (scala_vars knight1.scala)
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    49
  echo "  --> fail" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
  tsts0=$(( 1 ))
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
else
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    52
  echo "  --> success" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
  tsts0=$(( 0 )) 
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
# compilation test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
if [ $tsts0 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
then    
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    61
  echo "knight1.scala runs?" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
  if (scala_compile knight1.scala)
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
  then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    65
    echo "  --> success " | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
    tsts1=$(( 0 ))
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
  else
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    68
    echo "  --> scala did not run knight1.scala" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
    tsts1=$(( 1 )) 
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
  tsts1=$(( 1 ))   
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
### knight1a test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
if [ $tsts1 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    79
    echo " is_legal(8, Nil)(3, 4) == true " | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    80
    echo " is_legal(8, List((4, 1), (1, 0)))(4, 1) == false " | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    81
    echo " is_legal(2, Nil)(0, 0) == true" | tee -a $out                          
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    83
    if (scala_assert "knight1.scala" "knight1a_test.scala")
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
    then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    85
        echo "  --> success" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    86
	marks=$(( marks + 1 ))
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
    else
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    88
        echo "  --> test failed" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
    fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
### knight1b test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
if [ $tsts1 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    96
  echo " legal_moves(8, Nil, (2,2)) == List((3,4), (4,3), (4,1), (3,0), (1,0), (0,1), (0,3), (1,4))" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    97
  echo " legal_moves(8, Nil, (7,7)) == List((6,5), (5,6))" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    98
  echo " legal_moves(8, List((4,1), (1,0)), (2,2)) == List((3,4), (4,3), (3,0), (0,1), (0,3), (1,4))" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    99
  echo " legal_moves(8, List((6,6)), (7,7)) == List((6,5), (5,6))" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   100
  echo " legal_moves(1, Nil, (0,0)) == Nil" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   101
  echo " legal_moves(2, Nil, (0,0)) == Nil" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   102
  echo " legal_moves(3, Nil, (0,0)) == List((1,2), (2,1))" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
  
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   104
  if (scala_assert "knight1.scala" "knight1b_test.scala")
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
  then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   106
     echo "  --> success" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   107
     marks=$(( marks + 1 ))
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
  else
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   109
    echo "  --> test failed" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
### knight1c test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
if [ $tsts1 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   118
  echo " all_tours from every position on the board" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   119
  echo " dim = 1: 1" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
  echo "       2: 0,0,0,0" >>  $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
  echo "       3: 0,0,0,0,0,0,0,0,0" >>  $out
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   122
  echo "       4: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   123
  echo "       5: 304,0,56,0,304,0,56,0,56,0,56,0,64,0,56,0,56,0,56,0,304,0,56,0,304" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   124
  echo " enum_tours(5, List((0,2)) ) => 56 tours? and all correct?" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
  
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   126
  if (scala_assert "knight1.scala" "knight1c_test.scala") 
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
  then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   128
     echo "  --> success" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   129
     marks=$(( marks + 2 ))
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
  else
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   131
    echo "  --> test failed" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
# knights2: var test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   138
echo "knight2.scala does not contain vars, returns, Arrays, ListBuffers etc?" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
if (scala_vars knight2.scala)
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   142
  echo "  --> fail" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
  tsts0=$(( 1 ))
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
else
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   145
  echo "  --> success" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
  tsts0=$(( 0 )) 
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
# compilation test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
if  [ $tsts0 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
then    
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   153
  echo "knight2.scala runs?" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
  if (scala_compile knight2.scala)
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
  then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   157
    echo "  --> success" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
    tsts1=$(( 0 ))
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
  else
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   160
    echo "  --> scala did not run knight2.scala" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
    tsts1=$(( 1 )) 
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
  tsts1=$(( 1 ))     
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
### knight2a test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
if [ $tsts1 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   171
  echo " val f = (x:(Int, Int)) => if (x._1 > 3) Some(List(x)) else None " | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   172
  echo "   first(List((1,0),(2,0),(3,0),(4,0)), f) == Some(List((4,0)))" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   173
  echo "   first(List((1,0),(2,0),(3,0)), f) == None" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   175
  if (scala_assert "knight2.scala" "knight2a_test.scala") 
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
  then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   177
    echo "  --> success" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   178
    marks=$(( marks + 1 ))
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
  else
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   180
    echo "  --> test failed" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   184
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
### knight2b test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
if [ $tsts1 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   189
  echo " is first_tour(8, List((0, 0))) ok? " | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   190
  echo " is first_tour(4, List((0, 0))) == None " | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   191
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   192
  if (scala_assert "knight2.scala" "knight2b_test.scala") 
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
  then
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   194
     echo "  --> success" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   195
     marks=$(( marks + 2 ))
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196
  else
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   197
    echo "  --> test failed" | tee -a $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   198
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   199
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   200
245
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   201
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   202
## final marks
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   203
echo "Overall mark for Part 1" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   204
echo "$marks" | tee -a $out
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   205
975d34506e88 added marking
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
   206