testing3-bak/knight1_test.sh
author Christian Urban <urbanc@in.tum.de>
Thu, 06 Dec 2018 13:15:28 +0000
changeset 229 5549016ab10f
parent 204 9b45dd24271b
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
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
set -e
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
out=${1:-output}
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
echo "" > $out
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 "Below is the feedback for your submission of CW 7, Part 1 and 2." >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
echo "" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
# compilation tests
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
function scala_compile {
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    15
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> $out 1>> $out) 
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
}
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
# functional tests
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    20
function scala_assert_slow {
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    21
  (ulimit -t 120; JAVA_OPTS="-Xmx1g" scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    22
}
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    23
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    24
function scala_assert_thirty {
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    25
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    26
}
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    27
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    28
function scala_assert_quick {
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    29
  (ulimit -t 10; 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
    30
}
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
# purity test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
function scala_vars {
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    35
   (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
    36
}
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
# knights1: purity test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
echo "knight1.scala does not contain vars, returns etc?" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
if (scala_vars knight1.scala)
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
then
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    45
  echo "  --> fail: if you do not fix this, you will receive a mark of zero" >> $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
  tsts0=$(( 1 ))
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
  echo "  --> success" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
  tsts0=$(( 0 )) 
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
# compilation test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
if [ $tsts0 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
then    
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
  echo "knight1.scala runs?" >> $out
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 (scala_compile knight1.scala)
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
  then
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
    echo "  --> success " >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
    tsts1=$(( 0 ))
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
  else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
    echo "  --> scala did not run knight1.scala" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
    tsts1=$(( 1 )) 
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
  tsts1=$(( 1 ))   
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
### knight1a test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
if [ $tsts1 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
then
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    75
    echo "Takes 10 seconds or less to execute: " >> $out
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    76
    echo " is_legal(8, Nil)(3, 4) == true " >> $out
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    77
    echo " is_legal(8, List((4, 1), (1, 0)))(4, 1) == false " >> $out
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    78
    echo " is_legal(2, Nil)(0, 0) == true" >> $out                          
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    80
    if (scala_assert_quick "knight1.scala" "knight1a_test.scala")
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
    then
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
        echo "  --> success" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
    else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
        echo "  --> test failed" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
    fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
### knight1b test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
if [ $tsts1 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
then
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
    92
  echo "Takes 10 seconds or less to execute: " >> $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
  echo " legal_moves(8, Nil, (2,2)) == List((3,4), (4,3), (4,1), (3,0), (1,0), (0,1), (0,3), (1,4))" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
  echo " legal_moves(8, Nil, (7,7)) == List((6,5), (5,6))" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
  echo " legal_moves(8, List((4,1), (1,0)), (2,2)) == List((3,4), (4,3), (3,0), (0,1), (0,3), (1,4))" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
  echo " legal_moves(8, List((6,6)), (7,7)) == List((6,5), (5,6))" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  echo " legal_moves(1, Nil, (0,0)) == Nil" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
  echo " legal_moves(2, Nil, (0,0)) == Nil" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
  echo " legal_moves(3, Nil, (0,0)) == List((1,2), (2,1))" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
  
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
   101
  if (scala_assert_quick "knight1.scala" "knight1b_test.scala")
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
  then
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
    echo "  --> success" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
  else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
    echo "  --> test failed" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
### knight1c test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
if [ $tsts1 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
then
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
   114
  echo " all_tours from every position on the board, in 2 minutes or less" >> $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
  echo " dim = 1: 1" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
  echo "       2: 0,0,0,0" >>  $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
  echo "       3: 0,0,0,0,0,0,0,0,0" >>  $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
  echo "       4: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
  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" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
  echo " enum_tours(5, List((0,2)) ) == 56 and all correct?" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
  
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
   122
  if (scala_assert_slow "knight1.scala" "knight1c_test.scala") 
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
  then
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
    echo "  --> success" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
  else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
    echo "  --> test failed" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
# knights2: var test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
echo "knight2.scala does not contain vars, returns etc?" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
if (scala_vars knight2.scala)
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
then
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
  echo "  --> fail" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
  tsts0=$(( 1 ))
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
  echo "  --> success" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
  tsts0=$(( 0 )) 
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
# compilation test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
if  [ $tsts0 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
then    
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
  echo "knight2.scala runs?" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
  if (scala_compile knight2.scala)
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
  then
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
    echo "  --> success" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   153
    tsts1=$(( 0 ))
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
  else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
    echo "  --> scala did not run knight2.scala" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
    tsts1=$(( 1 )) 
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
  tsts1=$(( 1 ))     
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
### knight2a test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
if [ $tsts1 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
then
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
   166
  echo "Takes 10 seconds or less to execute: " >> $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
  echo " Let f = (x:(Int, Int)) => if (x._1 > 3) Some(List(x)) else None " >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
  echo "   first(List((1,0),(2,0),(3,0),(4,0)), f) == Some(List((4,0)))" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
  echo "   first(List((1,0),(2,0),(3,0)), f) == None" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
   171
  if (scala_assert_quick "knight2.scala" "knight2a_test.scala") 
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
  then
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
    echo "  --> success" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
  else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
    echo "  --> test failed" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
### knight2b test
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
if [ $tsts1 -eq 0 ]
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
then
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
   184
  echo "Takes 30 seconds or less to execute: " >> $out
152
114a89518aea updated
Christian Urban <urbanc@in.tum.de>
parents: 145
diff changeset
   185
  echo " is first_tour(8, List((0, 0))) ok? " >> $out
114a89518aea updated
Christian Urban <urbanc@in.tum.de>
parents: 145
diff changeset
   186
  echo " is first_tour(4, List((0, 0))) == None " >> $out
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents: 152
diff changeset
   188
  if (scala_assert_thirty "knight2.scala" "knight2b_test.scala") 
145
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
  then
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
    echo "  --> success" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   191
  else
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
    echo "  --> test failed" >> $out
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
  fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
fi
d306102fd33b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195