2 #------------------------------------------------------------------------------
4 # \\ / F ield | foam-extend: Open Source CFD
6 # \\ / A nd | For copyright notice see file Copyright
8 #------------------------------------------------------------------------------
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/>.
26 # addMissingAllrunFileToTutorial.sh
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
33 # Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
35 #------------------------------------------------------------------------------
39 # Location of a working copy of the test cases
42 DEFAULT_ALLRUN_FILE
=$2
44 # Find all the test cases
45 for SF
in `find ${TEST_RUN_DIR} -name system`
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