diff --git a/bin/foamRunTutorials b/bin/foamRunTutorials index 6b530e3cb983ced77140e6acf635abb4a239898d..a2c33cfb8e7935f4087738e0f18935f833bd5cf1 100755 --- a/bin/foamRunTutorials +++ b/bin/foamRunTutorials @@ -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 #------------------------------------------------------------------------------ diff --git a/bin/tools/MakefileDirs b/bin/tools/MakefileDirs index b6cd30092d003479858521863b3c1bf3461c6d58..1a0c45ba2d9985cdc78c2b1f7fd90d76b8da41f8 100644 --- a/bin/tools/MakefileDirs +++ b/bin/tools/MakefileDirs @@ -36,7 +36,7 @@ application: $(FOAM_TARGETS) $(FOAM_TARGETS): - +@(cd $@ && $(FOAM_APP)) + +@(cd $@ && $(FOAM_APP) $(FOAM_ARGS)) #------------------------------------------------------------------------------ diff --git a/tutorials/Allrun b/tutorials/Allrun index 3eddc44e93dda100053da41202d99cd38427304d..d4bdfb3dff2a7f740ba82ef1a1a3e6ed80723682 100755 --- a/tutorials/Allrun +++ b/tutorials/Allrun @@ -68,7 +68,7 @@ logReport() # Recursively run all tutorials -foamRunTutorials cases +foamRunTutorials -test -skipFirst # Analyse all log files diff --git a/tutorials/mesh/cvMesh/blob/Alltest b/tutorials/mesh/cvMesh/blob/Alltest new file mode 100755 index 0000000000000000000000000000000000000000..fc9136aea51b1f0ea208ef462afc59dbbb9b3693 --- /dev/null +++ b/tutorials/mesh/cvMesh/blob/Alltest @@ -0,0 +1,18 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication cvMesh + +# Change collapseEdges to only do one iteration +cp system/collapseDict system/collapseDict.org + +sed -e s/"\(maximumIterations[ \t]*\)\([0-9]*\);"/"\1 1;"/g \ +system/collapseDict.org > system/collapseDict + +runApplication collapseEdges -latestTime -collapseFaces + + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/cvMesh/flange/Alltest b/tutorials/mesh/cvMesh/flange/Alltest new file mode 100755 index 0000000000000000000000000000000000000000..75b5887193055fc87ce8120145c5e72d0c335399 --- /dev/null +++ b/tutorials/mesh/cvMesh/flange/Alltest @@ -0,0 +1,21 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication surfaceFeatureExtract + +# Create tight-fitting background mesh +runApplication blockMesh +runApplication cvMesh + +# Change collapseEdges to only do one iteration +cp system/collapseDict system/collapseDict.org + +sed -e s/"\(maximumIterations[ \t]*\)\([0-9]*\);"/"\1 1;"/g \ +system/collapseDict.org > system/collapseDict + +runApplication collapseEdges -latestTime -collapseFaces + +# ----------------------------------------------------------------- end-of-file