mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: foamRunTutorials: Enable Alltest files to be read as well as Allrun
foamRunTutorials now accepts two arguments: -test : Preferentially execute Alltest, if present, over Allrun. -skipFirst : Skip Alltest/Allrun at the top level to prevent recursion Added because some tutorials are not dependent on controlDict and take a long time.
This commit is contained in:
@ -37,6 +37,8 @@
|
||||
|
||||
# normally use "make"
|
||||
make="make"
|
||||
runTests=false
|
||||
skipFirst=false
|
||||
|
||||
## set WM_NCOMPPROCS automatically when both WM_HOSTS and WM_SCHEDULER are set
|
||||
#if [ -z "$WM_NCOMPPROCS" -a -n "$WM_HOSTS" -a -n "$WM_SCHEDULER" ]
|
||||
@ -73,8 +75,32 @@ then
|
||||
thisScript="$PWD/$thisScript"
|
||||
fi
|
||||
|
||||
|
||||
# parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
-t | -test)
|
||||
runTests=true
|
||||
shift
|
||||
;;
|
||||
-s | -skipFirst)
|
||||
skipFirst=true
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
# If an argument is supplied do not execute ./Allrun to avoid recursion
|
||||
if [ $# = 0 -a -f "./Allrun" ]
|
||||
if ! $skipFirst && $runTests && [ -f "./Alltest" ]
|
||||
then
|
||||
# Run a special test script.
|
||||
./Alltest
|
||||
elif ! $skipFirst && [ -f "./Allrun" ]
|
||||
then
|
||||
# Specialised script.
|
||||
./Allrun
|
||||
@ -104,7 +130,10 @@ else
|
||||
#done
|
||||
FOAM_TARGETS=$(for d in *; do [ -d "$d" ] && echo "$d"; done | xargs)
|
||||
#$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs FOAM_TARGETS="$FOAM_TARGETS" FOAM_APP="$WM_SCHEDULER $thisScript"
|
||||
$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs FOAM_TARGETS="$FOAM_TARGETS" FOAM_APP="$thisScript"
|
||||
|
||||
passArgs=$(if $runTests; then echo "-test"; fi)
|
||||
|
||||
$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs FOAM_TARGETS="$FOAM_TARGETS" FOAM_APP="$thisScript" FOAM_ARGS="$passArgs"
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user