edep-sim-validate.sh
Go to the documentation of this file.
1 #!/bin/bash
2 #
3 # Run tests on edep-sim. The tests kept in the fast-tests
4 # subdirectory will be run. Any tests that take a lot of time and are
5 # for more detailed validation should be kept in slow-tests. The
6 # slow-tests will only be run if the "-s" option is provided.
7 #
8 # This needs to be run in the validate subdirectory.
9 
10 TESTS="fast-tests"
11 
12 # Handle any input arguments
13 TEMP=$(getopt -o 's' -n "$0" -- "$@")
14 if [ $? -ne 0 ]; then
15  echo "Error ..."
16  exit 1
17 fi
18 eval set -- "$TEMP"
19 unset TEMP
20 while true; do
21  case "$1" in
22  '-s')
23  TESTS="${TESTS} slow-tests"
24  shift
25  continue;;
26  '--')
27  shift
28  break;
29  esac
30 done
31 
32 # Make a temporary macro file in the local directory.
33 OUTPUT_DIR="output.$(date +%Y-%m-%d-%H%M)"
34 mkdir ${OUTPUT_DIR}
35 for i in $(find ${TESTS} -name "[0-9]*" -type f); do
36  if [ -x ${i} ]; then
37  LOG=$(basename $i)
38  echo "(cd $OUTPUT_DIR && ../${i} >& ${LOG}.log || echo FAIL: $i)"
39  (cd $OUTPUT_DIR && ../${i} >& ${LOG}.log || echo FAIL: $i)
40  fi
41 done
42