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