mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: foamRunTutorials now skips tutorials with Allrun-optional
- for tutorials that are known to run poorly, can provide a placeholder Allrun-optional instead of the usual Allrun script. If this is detected, the case will be skipped.
This commit is contained in:
@ -4,23 +4,11 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||||
#
|
# <http://www.gnu.org/licenses/>.
|
||||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
# for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# foamRunTutorials
|
# foamRunTutorials
|
||||||
@ -29,6 +17,10 @@
|
|||||||
# Run either Allrun or blockMesh/application in current directory
|
# Run either Allrun or blockMesh/application in current directory
|
||||||
# and all its subdirectories.
|
# and all its subdirectories.
|
||||||
#
|
#
|
||||||
|
# For tutorials that are known to run poorly, an Allrun-optional
|
||||||
|
# placeholder can be used instead of the usual Allrun script.
|
||||||
|
# When this is detected, the case will be skipped.
|
||||||
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
|
||||||
@ -52,6 +44,8 @@ do
|
|||||||
passArgs="-test"
|
passArgs="-test"
|
||||||
runTests=true
|
runTests=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
# Avoid infinite recursion when invoked from an Allrun or Alltest script
|
||||||
-s | -skipFirst)
|
-s | -skipFirst)
|
||||||
skipFirst=true
|
skipFirst=true
|
||||||
;;
|
;;
|
||||||
@ -62,22 +56,23 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
# If an argument is supplied do not execute ./Allrun to avoid recursion
|
if ! $skipFirst && $runTests && test -f Alltest
|
||||||
if ! $skipFirst && $runTests && [ -f "./Alltest" ]
|
|
||||||
then
|
then
|
||||||
# Run speciallised Alltest script.
|
# Run specialized Alltest script
|
||||||
./Alltest $passArgs $*
|
./Alltest $passArgs $*
|
||||||
elif ! $skipFirst && [ -f "./Allrun" ]
|
elif ! $skipFirst && test -f Allrun
|
||||||
then
|
then
|
||||||
# Run specialised Allrun script.
|
# Run specialized Allrun script
|
||||||
./Allrun $passArgs $*
|
./Allrun $passArgs $*
|
||||||
|
elif ! $skipFirst && test -f Allrun-optional
|
||||||
|
then
|
||||||
|
# Found Allrun-optional script - skip this tutorial.
|
||||||
|
echo "Skipped optional case $PWD"
|
||||||
elif [ -d system ]
|
elif [ -d system ]
|
||||||
then
|
then
|
||||||
# Run normal case.
|
# Run normal case with blockMesh and the application
|
||||||
parentDir=$(dirname $PWD)
|
|
||||||
application=$(getApplication)
|
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
runApplication $application
|
runApplication $(getApplication)
|
||||||
else
|
else
|
||||||
# Loop over sub-directories and compile any applications
|
# Loop over sub-directories and compile any applications
|
||||||
for caseName in *
|
for caseName in *
|
||||||
|
|||||||
Reference in New Issue
Block a user