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