author | kleing |
Fri, 27 May 2005 01:09:44 +0200 | |
changeset 16095 | f6af6b265d20 |
parent 15937 | b74dfcdeac1b |
child 16178 | 754efc5afd5d |
permissions | -rwxr-xr-x |
13986 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# $Id$ |
|
4 |
# Author: Gerwin Klein, TU Muenchen |
|
5 |
# |
|
13993
88a8911bb65d
only make development snapshots for successful tests
kleing
parents:
13992
diff
changeset
|
6 |
# DESCRIPTION: sends email for failed tests, checks for error.log, |
88a8911bb65d
only make development snapshots for successful tests
kleing
parents:
13992
diff
changeset
|
7 |
# generates development snapshot if test ok |
13986 | 8 |
|
16095
f6af6b265d20
put global isatest settings in one file, sourced by the other scripts
kleing
parents:
15937
diff
changeset
|
9 |
## global settings |
f6af6b265d20
put global isatest settings in one file, sourced by the other scripts
kleing
parents:
15937
diff
changeset
|
10 |
. ~/admin/isatest-settings |
13986 | 11 |
|
14038 | 12 |
# produce empty list for patterns like isatest-*.log if no |
13 |
# such file exists |
|
14 |
shopt -s nullglob |
|
13986 | 15 |
|
16095
f6af6b265d20
put global isatest settings in one file, sourced by the other scripts
kleing
parents:
15937
diff
changeset
|
16 |
ADMIN="berghofe@in.tum.de kleing@in.tum.de" |
13993
88a8911bb65d
only make development snapshots for successful tests
kleing
parents:
13992
diff
changeset
|
17 |
|
13986 | 18 |
# mail program |
19 |
MAIL=$HOME/bin/pmail |
|
20 |
||
21 |
# tmp file for sending mail |
|
22 |
TMP=/tmp/isatest-makedist.$$ |
|
23 |
||
16095
f6af6b265d20
put global isatest settings in one file, sourced by the other scripts
kleing
parents:
15937
diff
changeset
|
24 |
export DISTPREFIX |
f6af6b265d20
put global isatest settings in one file, sourced by the other scripts
kleing
parents:
15937
diff
changeset
|
25 |
|
13986 | 26 |
|
27 |
## diagnostics |
|
28 |
||
29 |
PRG="$(basename "$0")" |
|
30 |
||
31 |
function usage() |
|
32 |
{ |
|
33 |
echo |
|
34 |
echo "Usage: $PRG" |
|
35 |
echo |
|
13993
88a8911bb65d
only make development snapshots for successful tests
kleing
parents:
13992
diff
changeset
|
36 |
echo " sends email for failed tests, checks for error.log," |
88a8911bb65d
only make development snapshots for successful tests
kleing
parents:
13992
diff
changeset
|
37 |
echo " generates development snapshot if test ok." |
13986 | 38 |
echo " To be called by cron." |
39 |
echo |
|
40 |
exit 1 |
|
41 |
} |
|
42 |
||
43 |
function fail() |
|
44 |
{ |
|
45 |
echo "$1" >&2 |
|
46 |
exit 2 |
|
47 |
} |
|
48 |
||
49 |
## main |
|
50 |
||
51 |
# check if tests are still running, wait for them to finish for max 10h |
|
52 |
i=0 |
|
13992 | 53 |
while [ -n "$(ls $RUNNING)" -a $i -lt 10 ]; do |
13986 | 54 |
sleep 3600 |
13992 | 55 |
let "i = i+1" |
13986 | 56 |
done |
57 |
||
58 |
# still running -> give up |
|
13992 | 59 |
if [ -n "$(ls $RUNNING)" ]; then |
13986 | 60 |
echo "giving up waiting for test to finish at $(date)" > $TMP |
61 |
echo >> $TMP |
|
62 |
echo "Have a nice day," >> $TMP |
|
63 |
echo " isatest" >> $TMP |
|
64 |
||
65 |
for R in $ADMIN; do |
|
13989 | 66 |
$MAIL "isabelle test taking to long" $R $TMP |
13986 | 67 |
done |
68 |
||
69 |
exit 1 |
|
70 |
fi |
|
71 |
||
72 |
# no tests running, check if there were errors |
|
73 |
if [ -e $ERRORLOG ]; then |
|
13992 | 74 |
cat $ERRORLOG > $TMP |
75 |
echo "Have a nice day," >> $TMP |
|
76 |
echo " isatest" >> $TMP |
|
13986 | 77 |
|
13992 | 78 |
for R in $MAILTO; do |
14038 | 79 |
LOGS=$ERRORDIR/isatest*.log |
14039 | 80 |
$MAIL "isabelle test failed" $R $TMP $LOGS |
13992 | 81 |
done |
13986 | 82 |
|
13992 | 83 |
rm $TMP |
84 |
exit 1 |
|
13986 | 85 |
fi |
86 |
||
13993
88a8911bb65d
only make development snapshots for successful tests
kleing
parents:
13992
diff
changeset
|
87 |
# generate development snapshot page only for successful tests |
88a8911bb65d
only make development snapshots for successful tests
kleing
parents:
13992
diff
changeset
|
88 |
(cd $HOME/devel-page; env DISTNAME=`$DISTPREFIX/Isabelle/bin/isatool version` make) |
88a8911bb65d
only make development snapshots for successful tests
kleing
parents:
13992
diff
changeset
|
89 |
echo "$(date) $HOSTNAME $PRG: generated development snapshot web page." >> $MASTERLOG |
88a8911bb65d
only make development snapshots for successful tests
kleing
parents:
13992
diff
changeset
|
90 |
|
13992 | 91 |
exit 0 |
13986 | 92 |
## end |