3 # Author: Gerwin Klein, TU Muenchen
5 # DESCRIPTION: Run isabelle makeall from specified distribution and settings.
8 . ~/admin/isatest/isatest-settings
10 # max time until test is aborted (in sec)
13 PUBLISH_TEST="$HOME/home/isabelle-repository/repos/testtool/publish_test.py"
17 PRG="$(basename "$0")"
22 echo "Usage: $PRG [-l logic targets] settings1 [settings2 ...]"
24 echo " Runs isabelle makeall for specified settings."
25 echo " Leaves messages in ${ERRORLOG} and ${LOGPREFIX} if it fails."
28 echo " $PRG ~/settings/at-poly ~/settings/at-sml"
29 echo " $PRG -l HOL \"HOL-Library HOL-Bali\" ~/settings/at-poly"
44 [ "$1" = "-?" ] && usage
45 [ "$#" -lt "1" ] && usage
47 [ -d $DISTPREFIX ] || fail "$DISTPREFIX is not a directory."
49 # make file flags and nice setup for different target platforms
102 ISABELLE_TOOL="$DISTPREFIX/Isabelle/bin/isabelle"
104 [ -x $ISABELLE_TOOL ] || fail "Cannot run $ISABELLE_TOOL"
106 if [ "$1" = "-l" ]; then
108 [ "$#" -lt "3" ] && usage
112 ISABELLE_HOME="$($ISABELLE_TOOL getenv -b ISABELLE_HOME)"
113 DIR="$ISABELLE_HOME/src/$LOGIC"
114 TOOL="$ISABELLE_TOOL make $MFLAGS $TARGETS"
117 TOOL="$ISABELLE_TOOL makeall $MFLAGS all"
120 IDENT=$(cat "$DISTPREFIX/ISABELLE_IDENT")
126 for SETTINGS in $@; do
128 [ -r $SETTINGS ] || fail "Cannot read $SETTINGS."
132 DATE=$(date "+%Y-%m-%d")
133 SHORT=${SETTINGS##*/}
135 if [ "${SHORT%-e}" == "$SHORT" ]; then
137 TESTLOG=$LOGPREFIX/isatest-makeall-$SHORT-$DATE-$HOSTNAME.log
140 TESTLOG=$LOGPREFIX/isatest-makeall-$SHORT-$DATE-$HOSTNAME-e.log
145 touch $RUNNING/$SHORT.running
147 echo ------------------- starting test --- `date` --- $HOSTNAME > $TESTLOG 2>&1
149 echo "Isabelle version: $IDENT" >> $TESTLOG 2>&1
151 if [ "${ISABELLE_HOME_USER:0:14}" == "/tmp/isabelle-" ]; then
152 echo "--- cleaning up old $ISABELLE_HOME_USER"
153 rm -rf $ISABELLE_HOME_USER
156 cp $DISTPREFIX/Isabelle/etc/settings.orig $DISTPREFIX/Isabelle/etc/settings
157 cat $SETTINGS >> $DISTPREFIX/Isabelle/etc/settings
158 (ulimit -t $MAXTIME; cd $DIR; $NICE $TOOL >> $TESTLOG 2>&1)
162 # test log and cleanup
163 echo ------------------- test successful --- `date` --- $HOSTNAME >> $TESTLOG 2>&1
164 if [ -x $PUBLISH_TEST ]; then
165 $PUBLISH_TEST -r $IDENT -s "SUCCESS" -a log $TESTLOG -n Makeall_isatest_$SHORT
170 echo ------------------- test FAILED --- `date` --- $HOSTNAME >> $TESTLOG 2>&1
171 if [ -x $PUBLISH_TEST ]; then
172 $PUBLISH_TEST -r $IDENT -s "FAIL" -a log $TESTLOG -n Makeall_isatest_$SHORT
176 echo "Test for platform ${SHORT} failed. Log file attached." >> $ERRORLOG
177 echo "[...]" >> $ERRORLOG
178 tail -3 $TESTLOG >> $ERRORLOG
182 (cd $ERRORDIR; cp $TESTLOG .)
185 rm -f $RUNNING/$SHORT.running
188 # time and success/failure to master log
189 ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
191 if [ -z "$FAIL" ]; then
192 log "all tests successful, elapsed time $ELAPSED."
194 log "targets ${FAIL}FAILED, elapsed time $ELAPSED."