marking3/knight1_test.sh
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 23 Dec 2022 16:52:34 +0000
changeset 456 d076cb2e0b75
parent 384 6e1237691307
permissions -rwxr-xr-x
updated jars
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
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    11
echo "for Preliminary 8.  Please note all marks are provisional until" >> $out
243
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
function scala_compile {
384
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 331
diff changeset
    23
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1") # 2>> $out 1>> $out) 
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
}
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
# functional tests
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    28
function scala_assert_slow {
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    29
  (ulimit -t 120; JAVA_OPTS="-Xmx1g" scala -i "$1" "-- $2" 2> /dev/null 1> /dev/null)
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    30
}
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    31
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    32
function scala_assert_thirty {
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    33
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" 2> /dev/null 1> /dev/null)
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    34
}
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    35
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    36
function scala_assert_quick {
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    37
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" 2> /dev/null 1> /dev/null)
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    38
}
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    39
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
function scala_assert {
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    41
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala  -i "$1" -- "$2" 2> /dev/null 1> /dev/null)
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
}
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
244
a359976a6f3e updated
Christian Urban <urbanc@in.tum.de>
parents: 243
diff changeset
    44
function scala_assert_long {
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    45
  (ulimit -t 60; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" -2> /dev/null 1> /dev/null)
244
a359976a6f3e updated
Christian Urban <urbanc@in.tum.de>
parents: 243
diff changeset
    46
}
a359976a6f3e updated
Christian Urban <urbanc@in.tum.de>
parents: 243
diff changeset
    47
a359976a6f3e updated
Christian Urban <urbanc@in.tum.de>
parents: 243
diff changeset
    48
function scala_assert_elong {
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    49
  (ulimit -t 90; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" 2> /dev/null 1> /dev/null)
244
a359976a6f3e updated
Christian Urban <urbanc@in.tum.de>
parents: 243
diff changeset
    50
}
a359976a6f3e updated
Christian Urban <urbanc@in.tum.de>
parents: 243
diff changeset
    51
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
# purity test
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
function scala_vars {
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
   (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
    56
}
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
# knights1: purity test
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
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
    62
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
if (scala_vars knight1.scala)
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
then
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    65
  echo "  --> FAIL" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
  tsts0=$(( 1 ))
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
else
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
  echo "  --> success" | tee -a $out
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
  tsts0=$(( 0 )) 
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
# compilation test
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
if [ $tsts0 -eq 0 ]
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
then    
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
  echo "knight1.scala runs?" | tee -a $out
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
  if (scala_compile knight1.scala)
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
  then
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
    echo "  --> success " | tee -a $out
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
    tsts1=$(( 0 ))
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
  else
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
    84
    echo -e "  --> SCALA DID NOT RUN KNIGHT1.SCALA\n" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
    tsts1=$(( 1 )) 
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
  fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
else
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
  tsts1=$(( 1 ))   
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
### knight1 test
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
if [ $tsts1 -eq 0 ]
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
then
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
    echo " is_legal(8, Nil, (3, 4)) == true " | tee -a $out
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
    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
    97
    echo " is_legal(2, Nil, (0, 0)) == true" | tee -a $out                          
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
    if (scala_assert "knight1.scala" "knight1_test1.scala")
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
    then
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   101
        echo -e "  --> success\n" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
	marks=$(( marks + 1 ))
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
    else
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   104
        echo -e "  --> \n ONE TEST FAILED\n"| tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
    fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
### knight2 test
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
if [ $tsts1 -eq 0 ]
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
then
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
  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
   113
  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
   114
  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
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   115
  echo " legal_moves(8, Nil, (0,1)) == List((1,3), (2,2), (2,0))" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
  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
   117
  echo " legal_moves(1, Nil, (0,0)) == Nil" | tee -a $out
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
  echo " legal_moves(2, Nil, (0,0)) == Nil" | tee -a $out
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
  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
   120
  
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
  if (scala_assert "knight1.scala" "knight1_test2.scala")
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
  then
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   123
     echo -e "  --> success\n" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
     marks=$(( marks + 1 ))
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
  else
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   126
     echo -e "  --> \n ONE TEST FAILED\n" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
  fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
### knight3 test
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
if [ $tsts1 -eq 0 ]
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
then
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
  echo " all_tours from every position on the board" | tee -a $out
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
  echo " dim = 1: 1" | tee -a $out
244
a359976a6f3e updated
Christian Urban <urbanc@in.tum.de>
parents: 243
diff changeset
   137
  echo "       2: 0,0,0,0" | tee -a $out
a359976a6f3e updated
Christian Urban <urbanc@in.tum.de>
parents: 243
diff changeset
   138
  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
   139
  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
   140
  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
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   141
  START=$(date +%s)
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
  
384
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 331
diff changeset
   143
  if (scala_assert "knight1.scala" "knight1_test3a.scala") 
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
  then
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   145
     END=$(date +%s)
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   146
     DIFF=$(( $END - $START ))
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   147
     echo " It took $DIFF seconds" | tee -a $out  
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   148
     echo -e "  --> success\n" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
     marks=$(( marks + 1 ))
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
  else
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   151
     END=$(date +%s)
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   152
     DIFF=$(( $END - $START ))
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   153
     echo " It took $DIFF seconds" | tee -a $out 
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   154
     echo -e "  --> \n ONE TEST FAILED\n" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
  fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
if [ $tsts1 -eq 0 ]
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
then
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
  echo " enum_tours(5, List((0,2)) ) => 56 tours? and all correct?" | tee -a $out
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   161
  echo " enum_tours(5, List((0,0)) ) => 304 tours? and all correct?" | tee -a $out
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   162
  START=$(date +%s)
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
  
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   164
  if (scala_assert "knight1.scala" "knight1_test3b.scala") 
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
  then
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   166
     END=$(date +%s)
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   167
     DIFF=$(( $END - $START ))
331
e3878cdd38bc updated
Christian Urban <urbanc@in.tum.de>
parents: 326
diff changeset
   168
     echo "  It took $DIFF seconds" | tee -a $out 
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   169
     echo -e "  --> success\n" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
     marks=$(( marks + 1 ))
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
  else
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   172
     END=$(date +%s)
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   173
     DIFF=$(( $END - $START ))
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   174
     echo " It took $DIFF seconds" | tee -a $out 
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   175
     echo -e "  --> \n ONE TEST FAILED\n" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
  fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
fi
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
## final marks
326
e5453add7df6 updated
Christian Urban <urbanc@in.tum.de>
parents: 250
diff changeset
   181
echo "Overall mark for Preliminary 8" | tee -a $out
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
echo "$marks" | tee -a $out
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   184