OpenFOAM: v1912 released! - For more information see https://www.openfoam.com/releases/openfoam-v1912

Allrun 1.84 KB
Newer Older
1
#!/bin/sh
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#------------------------------------------------------------------------------
# =========                 |
# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
#  \\    /   O peration     |
#   \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
#    \\/     M anipulation  |
#------------------------------------------------------------------------------
# License
#     This file is part of OpenFOAM, licensed under GNU General Public License
#     <http://www.gnu.org/licenses/>.
#
# Script
#     Allrun
#
# Description
#     Run tutorial cases and summarize the outcome as 'testLoopReport'
#
#------------------------------------------------------------------------------
20 21
cd ${0%/*} || exit 1    # Run from this directory

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
usage()
{
    exec 1>&2
    while [ "$#" -ge 1 ]; do echo "$1"; shift; done
    cat<<USAGE

usage: ${0##*/} [OPTION]

options:
  -collect          Collect logs only. Can be useful for aborted runs.
  -help             print the usage

Run tutorial cases and summarize the outcome as 'testLoopReport'

USAGE
    exit 1
}

40
#------------------------------------------------------------------------------
41
unset optCollectOnly
42

43 44
# Parse options
while [ "$#" -gt 0 ]
45
do
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
    case "$1" in
    -h | -help)
        usage
        ;;
    -collect)
        optCollectOnly=true
        ;;
    -test)   # Known options that should be passed through
        break
        ;;
    -*)
        usage "unknown option: $1"
        ;;
    *)
        break
        ;;
    esac
    shift
64 65 66
done


67 68 69 70 71 72 73 74 75 76
#------------------------------------------------------------------------------
. $WM_PROJECT_DIR/bin/tools/LogFunctions    # Tutorial log-file functions

if [ -z "$optCollectOnly" ]
then
    foamRunTutorials -skipFirst $*          # Run tutorials recursively
fi

collectLogs

77
#------------------------------------------------------------------------------