mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
tutorials: Added exit code to Allrun and Alltest scripts
Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
This commit is contained in:
@ -39,6 +39,7 @@ dir=${PWD##*/}
|
||||
# Extracts useful info from log file.
|
||||
logReport()
|
||||
{
|
||||
err=0
|
||||
caseName=`dirname $1 | sed s/"\(.*\)\.\/"/""/g`
|
||||
app=`echo $1 | sed s/"\(.*\)log\."/""/g`
|
||||
appAndCase="Application $app - case $caseName"
|
||||
@ -52,9 +53,11 @@ logReport()
|
||||
if [ "$fatalError" ]
|
||||
then
|
||||
echo "$appAndCase: ** FOAM FATAL ERROR **"
|
||||
err=1
|
||||
elif [ "$UxSS" -a "$UySS" -a "$UzSS" ]
|
||||
then
|
||||
echo "$appAndCase: ** Solution singularity **"
|
||||
err=1
|
||||
elif [ "$completed" ]
|
||||
then
|
||||
completionTime=`tail -10 $log | grep Execution | cut -d= -f2 | sed 's/^[ \t]*//'`
|
||||
@ -65,7 +68,10 @@ logReport()
|
||||
echo "$appAndCase: completed $completionTime"
|
||||
else
|
||||
echo "$appAndCase: unconfirmed completion"
|
||||
err=1
|
||||
fi
|
||||
|
||||
return $err
|
||||
}
|
||||
|
||||
|
||||
@ -76,23 +82,31 @@ foamRunTutorials -test -skipFirst
|
||||
# Analyse all log files
|
||||
rm testLoopReport > /dev/null 2>&1 &
|
||||
touch testLoopReport
|
||||
runErr=0
|
||||
|
||||
for appDir in *
|
||||
do
|
||||
(
|
||||
[ -d $appDir ] && cd $appDir || exit
|
||||
appDirErr=$(
|
||||
logErr=0
|
||||
[ -d $appDir ] && cd $appDir || exit
|
||||
|
||||
logs=`find . -name "log.*"`
|
||||
[ -n "$logs" ] || exit
|
||||
logs=`find . -name "log.*"`
|
||||
[ -n "$logs" ] || exit
|
||||
|
||||
for log in `echo $logs | xargs ls -rt`
|
||||
do
|
||||
logReport $log >> ../testLoopReport
|
||||
done
|
||||
echo "" >> ../testLoopReport
|
||||
)
|
||||
for log in `echo $logs | xargs ls -rt`
|
||||
do
|
||||
logReport $log >> ../testLoopReport
|
||||
[ $? -gt 0 ] && logErr=$((logErr+1))
|
||||
done
|
||||
echo "" >> ../testLoopReport
|
||||
echo $logErr
|
||||
)
|
||||
|
||||
[ -n "$appDirErr" ] && [ $appDirErr -gt 0 ] && runErr=1
|
||||
done
|
||||
|
||||
find . -name "log.*" -exec cat {} \; >> logs
|
||||
|
||||
exit $runErr
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user