author | wenzelm |
Fri, 13 Jan 2006 01:13:17 +0100 | |
changeset 18673 | fad60fe1565c |
parent 17483 | c6005bfc1630 |
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 |
|
17483 | 21 |
echo "Usage: $PRG settings1 [settings2 ...]" |
13231 | 22 |
echo |
17483 | 23 |
echo " Runs isatool makeall for specified settings." |
13985
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 |
|
16097 | 32 |
echo "$(date) $HOSTNAME $PRG: FAILED, $1" >> $MASTERLOG |
13231 | 33 |
exit 2 |
34 |
} |
|
35 |
||
36 |
## main |
|
37 |
||
38 |
# argument checking |
|
39 |
||
40 |
[ "$1" = "-?" ] && usage |
|
16095
f6af6b265d20
put global isatest settings in one file, sourced by the other scripts
kleing
parents:
15888
diff
changeset
|
41 |
[ "$#" -lt "1" ] && usage |
13231 | 42 |
|
43 |
[ -d $DISTPREFIX ] || fail "$DISTPREFIX is not a directory." |
|
44 |
||
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
45 |
# make file flags and nice setup for different target platforms |
13838 | 46 |
case $HOSTNAME in |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
47 |
atbroy51) |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
48 |
# 2 processors |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
49 |
MFLAGS="-j 2" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
50 |
# MFLAGS="" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
51 |
NICE="" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
52 |
;; |
13838 | 53 |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
54 |
atbroy31) |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
55 |
# cluster |
13838 | 56 |
MFLAGS="-j 5" |
57 |
;; |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
58 |
|
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
59 |
sunbroy2) |
13990 | 60 |
MFLAGS="-j 6" |
16097 | 61 |
NICE="nice" |
13985
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 |
|
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
64 |
sunbroy1) |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
65 |
MFLAGS="-j 2" |
16097 | 66 |
NICE="nice" |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
67 |
;; |
13838 | 68 |
|
16567 | 69 |
macbroy5) |
16617 | 70 |
MFLAGS="" # -j 2 does not work on poly/macos 10.4.1 |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
71 |
NICE="" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
72 |
;; |
13838 | 73 |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
74 |
*) |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
75 |
MFLAGS="" |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
76 |
# be nice by default |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
77 |
NICE=nice |
13838 | 78 |
;; |
79 |
esac |
|
80 |
||
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
81 |
# main test loop |
13320 | 82 |
|
13231 | 83 |
for SETTINGS in $@; do |
84 |
||
85 |
[ -r $SETTINGS ] || fail "Cannot read $SETTINGS." |
|
86 |
||
87 |
# logfile setup |
|
88 |
||
13432
470daa444967
- changed date format for proper lexicographical ordering
isatest
parents:
13359
diff
changeset
|
89 |
DATE=$(date "+%Y-%m-%d") |
13231 | 90 |
SHORT=${SETTINGS##*/} |
91 |
TESTLOG=$LOGPREFIX/isatest-makeall-$SHORT-$DATE-$HOSTNAME.log |
|
92 |
||
93 |
# the test |
|
94 |
||
13987 | 95 |
touch $RUNNING/$SHORT.running |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
96 |
|
13231 | 97 |
echo ------------------- starting test --- `date` --- $HOSTNAME > $TESTLOG 2>&1 |
98 |
||
13233 | 99 |
cat $SETTINGS >> $DISTPREFIX/Isabelle/etc/settings |
15888 | 100 |
(ulimit -t $MAXTIME; $NICE $DISTPREFIX/Isabelle/bin/isatool makeall $MFLAGS all >> $TESTLOG 2>&1) |
13231 | 101 |
|
102 |
if [ $? -eq 0 ] |
|
103 |
then |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
104 |
# test log and cleanup |
13236 | 105 |
echo ------------------- test successful --- `date` --- $HOSTNAME >> $TESTLOG 2>&1 |
13231 | 106 |
gzip -f $TESTLOG |
107 |
else |
|
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
108 |
# test log |
13231 | 109 |
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
|
110 |
|
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
111 |
# error log |
14035 | 112 |
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
|
113 |
echo "[...]" >> $ERRORLOG |
14035 | 114 |
tail -3 $TESTLOG >> $ERRORLOG |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
115 |
echo >> $ERRORLOG |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
116 |
|
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
117 |
FAIL="$FAIL$SHORT " |
14035 | 118 |
(cd $ERRORDIR; ln -s $TESTLOG) |
13231 | 119 |
fi |
120 |
||
13987 | 121 |
rm -f $RUNNING/$SHORT.running |
13231 | 122 |
done |
123 |
||
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
124 |
# time and success/failure to master log |
13236 | 125 |
ELAPSED=$("$HOME/bin/showtime" "$SECONDS") |
126 |
||
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
127 |
if [ -z "$FAIL" ]; then |
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
128 |
echo "$(date) $HOSTNAME $PRG: all tests successful, elapsed time $ELAPSED." >> $MASTERLOG |
13236 | 129 |
else |
13985
3852929a8d1d
leave error messages in error.log, send only one email for all platforms
kleing
parents:
13962
diff
changeset
|
130 |
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
|
131 |
exit 1 |
13236 | 132 |
fi |
133 |
||
134 |
# end |