Admin/isatest-makeall
author kleing
Thu, 20 Jun 2002 21:45:14 +0200
changeset 13231 cce28efb2600
child 13232 8b1b5e8c4bd6
permissions -rwxr-xr-x
for nightly test builds
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     1
#!/usr/bin/env bash
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     2
#
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     3
# $Id$
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     4
# Author: Gerwin Klein, TU Muenchen
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     5
# License: GPL (GNU GENERAL PUBLIC LICENSE)
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     6
#
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     7
# DESCRIPTION: Run isatool makeall from specified distribution and settings.
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     8
#              Send email if it fails.
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     9
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    10
## global settings
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    11
LOGPREFIX=~
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    12
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    13
## diagnostics
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    14
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    15
PRG="$(basename "$0")"
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    16
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    17
function usage()
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    18
{
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    19
  echo
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    20
  echo "Usage: $PRG distributionpath settings1 [settings2 ...]"
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    21
  echo
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    22
  echo "  Run isatool makeall from specified distribution and settings."
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    23
  echo "  Send email if it fails."
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    24
  echo
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    25
  exit 1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    26
}
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    27
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    28
function fail()
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    29
{
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    30
  echo "$1" >&2
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    31
  exit 2
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    32
}
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    33
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    34
## main
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    35
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    36
# argument checking
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    37
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    38
[ "$1" = "-?" ] && usage
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    39
[ "$#" -lt "2" ] && usage
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    40
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    41
DISTPREFIX=$1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    42
shift
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    43
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    44
[ -d $DISTPREFIX ] || fail "$DISTPREFIX is not a directory."
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    45
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    46
for SETTINGS in $@; do
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    47
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    48
    [ -r $SETTINGS ] || fail "Cannot read $SETTINGS."
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    49
    
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    50
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    51
    # logfile setup
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    52
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    53
    DATE=$(date "+%d-%b-%Y")
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    54
    SHORT=${SETTINGS##*/}
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    55
    TESTLOG=$LOGPREFIX/isatest-makeall-$SHORT-$DATE-$HOSTNAME.log
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    56
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    57
    # the test
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    58
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    59
    echo ------------------- starting test --- `date` --- $HOSTNAME > $TESTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    60
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    61
    cp -v $SETTINGS $DISTPREFIX/Isabelle/etc/settings >> $TESTLOG 2>&1 
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    62
    $DISTPREFIX/Isabelle/bin/isatool makeall all >> $TESTLOG 2>&1 
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    63
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    64
    if [ $? -eq 0 ]
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    65
    then
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    66
        echo ------------------- test successfull --- `date` --- $HOSTNAME >> $TESTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    67
        gzip -f $TESTLOG
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    68
    else
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    69
        echo ------------------- test FAILED --- `date` --- $HOSTNAME >> $TESTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    70
        # more action here
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    71
        exit 1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    72
    fi
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    73
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    74
done
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    75
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    76
# end