testHarness: various adjustments for foam-extend 3.2. The results will now be reporte...
[foam-extend-3.2.git] / testHarness / foam-extend / 3.2 / scripts / addMissingAllrunFileToTutorial.sh
blobdd2a528a6e1c5f9053ecbca12484633ceeb91751
1 #!/bin/bash
2 #------------------------------------------------------------------------------
3 # ========= |
4 # \\ / F ield | foam-extend: Open Source CFD
5 # \\ / O peration |
6 # \\ / A nd | For copyright notice see file Copyright
7 # \\/ M anipulation |
8 #------------------------------------------------------------------------------
9 # License
10 # This file is part of foam-extend.
12 # foam-extend is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by the
14 # Free Software Foundation, either version 3 of the License, or (at your
15 # option) any later version.
17 # foam-extend is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 # General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 # Script
26 # addMissingAllrunFileToTutorial.sh
28 # Description
29 # Add a default Allrun file to the tutorials that do not have one.
30 # The test harness only run tutorials with an existing Allrun file
32 # Author:
33 # Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
35 #------------------------------------------------------------------------------
37 #set -x
39 # Location of a working copy of the test cases
40 TEST_RUN_DIR=$1
42 DEFAULT_ALLRUN_FILE=$2
44 # Find all the test cases
45 for SF in `find ${TEST_RUN_DIR} -name system`
47 caseDir=`dirname $SF`
48 tutDir=`dirname $caseDir`
50 # First, some sanity check:
51 if [ $tutDir == $TEST_RUN_DIR ]; then
52 echo "--> WARNING: Badly placed tutorial: $caseDir"
55 # Check if an Allrun file is present
56 if [ ! -e $caseDir/Allrun ]; then
58 # Sometimes, a global Allrun file is located at the tutorial level
59 if [ ! -e $tutDir/Allrun ]; then
60 # No Allrun file for this case. Let's add one.
61 echo "Adding a default Allrun file for tutorial : $caseDir"
62 cp $DEFAULT_ALLRUN_FILE $caseDir/Allrun
65 done
67 echo "Done."