author | kleing |
Fri, 27 May 2005 01:09:44 +0200 | |
changeset 16095 | f6af6b265d20 |
parent 15888 | 64533471eec4 |
child 16097 | 8d41765e2884 |
permissions | -rwxr-xr-x |
13231 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# $Id$ |
|
4 |
# Author: Gerwin Klein, TU Muenchen |
|
5 |
# |
|
6 |
# DESCRIPTION: Run isatool makeall from specified distribution and settings. |
|
13962
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents:
13924
diff
changeset
|
7 |
|
13231 | 8 |
## global settings |
16095
f6af6b265d20
put global isatest settings in one file, sourced by the other scripts
kleing
parents:
15888
diff
changeset
|
9 |
. ~/admin/isatest-settings |
13320 | 10 |
|
15888 | 11 |
# max time until test is aborted (in sec) |
12 |
MAXTIME=28800 |
|
13320 | 13 |
|
13231 | 14 |
## diagnostics |
15 |
||
16 |
PRG="$(basename "$0")" |
|
17 |
||
18 |
function usage() |
|
19 |
{ |
|
20 |
echo |
|
21 |
echo "Usage: $PRG distributionpath settings1 [settings2 ...]" |
|
22 |
echo |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
23 |
echo " Runs isatool makeall from specified distribution and settings." |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
24 |
echo " Leaves messages in ${ERRORLOG} and ${LOGPREFIX} if it fails." |
13231 | 25 |
echo |
26 |
exit 1 |
|
27 |
} |
|
28 |
||
29 |
function fail() |
|
30 |
{ |
|
31 |
echo "$1" >&2 |
|
32 |
exit 2 |
|
33 |
} |
|
34 |
||
35 |
## main |
|
36 |
||
37 |
# argument checking |
|
38 |
||
39 |
[ "$1" = "-?" ] && usage |
|
16095
f6af6b265d20
put global isatest settings in one file, sourced by the other scripts
kleing
parents:
15888
diff
changeset
|
40 |
[ "$#" -lt "1" ] && usage |
13231 | 41 |
|
42 |
[ -d $DISTPREFIX ] || fail "$DISTPREFIX is not a directory." |
|
43 |
||
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
44 |
# make file flags and nice setup for different target platforms |
13838 | 45 |
case $HOSTNAME in |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
46 |
atbroy51) |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
47 |
# 2 processors |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
48 |
MFLAGS="-j 2" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
49 |
# MFLAGS="" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
50 |
NICE="" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
51 |
;; |
13838 | 52 |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
53 |
atbroy31) |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
54 |
# cluster |
13838 | 55 |
MFLAGS="-j 5" |
56 |
;; |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
57 |
|
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
58 |
sunbroy2) |
13990 | 59 |
MFLAGS="-j 6" |
14012 | 60 |
NICE="nice" |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
61 |
;; |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
62 |
|
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
63 |
sunbroy1) |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
64 |
MFLAGS="-j 2" |
14012 | 65 |
NICE="nice" |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
66 |
;; |
13838 | 67 |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
68 |
macbroy*) |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
69 |
MFLAGS="" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
70 |
NICE="" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
71 |
;; |
13838 | 72 |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
73 |
*) |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
74 |
MFLAGS="" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
75 |
# be nice by default |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
76 |
NICE=nice |
13838 | 77 |
;; |
78 |
esac |
|
79 |
||
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
80 |
# main test loop |
13320 | 81 |
|
13231 | 82 |
for SETTINGS in $@; do |
83 |
||
84 |
[ -r $SETTINGS ] || fail "Cannot read $SETTINGS." |
|
85 |
||
86 |
# logfile setup |
|
87 |
||
13432
470daa444967
- changed date format for proper lexicographical ordering
isatest
parents:
13359
diff
changeset
|
88 |
DATE=$(date "+%Y-%m-%d") |
13231 | 89 |
SHORT=${SETTINGS##*/} |
90 |
TESTLOG=$LOGPREFIX/isatest-makeall-$SHORT-$DATE-$HOSTNAME.log |
|
91 |
||
92 |
# the test |
|
93 |
||
13987 | 94 |
touch $RUNNING/$SHORT.running |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
95 |
|
13231 | 96 |
echo ------------------- starting test --- `date` --- $HOSTNAME > $TESTLOG 2>&1 |
97 |
||
13233 | 98 |
cat $SETTINGS >> $DISTPREFIX/Isabelle/etc/settings |
15888 | 99 |
(ulimit -t $MAXTIME; $NICE $DISTPREFIX/Isabelle/bin/isatool makeall $MFLAGS all >> $TESTLOG 2>&1) |
13231 | 100 |
|
101 |
if [ $? -eq 0 ] |
|
102 |
then |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
103 |
# test log and cleanup |
13236 | 104 |
echo ------------------- test successful --- `date` --- $HOSTNAME >> $TESTLOG 2>&1 |
13231 | 105 |
gzip -f $TESTLOG |
106 |
else |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
107 |
# test log |
13231 | 108 |
echo ------------------- test FAILED --- `date` --- $HOSTNAME >> $TESTLOG 2>&1 |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
109 |
|
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
110 |
# error log |
14035 | 111 |
echo "Test for platform ${SHORT} failed. Log file attached." >> $ERRORLOG |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
112 |
echo "[...]" >> $ERRORLOG |
14035 | 113 |
tail -3 $TESTLOG >> $ERRORLOG |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
114 |
echo >> $ERRORLOG |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
115 |
|
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
116 |
FAIL="$FAIL$SHORT " |
14035 | 117 |
(cd $ERRORDIR; ln -s $TESTLOG) |
13231 | 118 |
fi |
119 |
||
13987 | 120 |
rm -f $RUNNING/$SHORT.running |
13231 | 121 |
done |
122 |
||
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
123 |
# time and success/failure to master log |
13236 | 124 |
ELAPSED=$("$HOME/bin/showtime" "$SECONDS") |
125 |
||
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
126 |
if [ -z "$FAIL" ]; then |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
127 |
echo "$(date) $HOSTNAME $PRG: all tests successful, elapsed time $ELAPSED." >> $MASTERLOG |
13236 | 128 |
else |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
129 |
echo "$(date) $HOSTNAME $PRG: targets ${FAIL}FAILED, elapsed time $ELAPSED." >> $MASTERLOG |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
130 |
exit 1 |
13236 | 131 |
fi |
132 |
||
133 |
# end |