author | bulwahn |
Fri, 11 Mar 2011 10:37:42 +0100 | |
changeset 41912 | 1848775589e5 |
parent 33859 | 033ce4cafba6 |
child 48212 | cccc92c0addc |
permissions | -rwxr-xr-x |
33831 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# Author: Makarius |
|
4 |
# |
|
5 |
# DESCRIPTION: minimal test of current repository version |
|
6 |
||
7 |
## global settings |
|
8 |
||
9 |
MAXTIME=14400 |
|
10 |
||
11 |
DATE=$(date "+%Y-%m-%d_%H:%M") |
|
12 |
HOST=$(hostname -s) |
|
13 |
||
14 |
LOGDIR="$HOME/log" |
|
15 |
LOG="$LOGDIR/test-${DATE}-${HOST}.log" |
|
16 |
||
33859
033ce4cafba6
do not add host suffix -- it is appended by test framework
krauss
parents:
33831
diff
changeset
|
17 |
TEST_NAME="minimal-test" |
33831 | 18 |
PUBLISH_TEST="/home/isabelle-repository/repos/testtool/publish_test.py" |
19 |
||
20 |
||
21 |
## diagnostics |
|
22 |
||
23 |
function fail() |
|
24 |
{ |
|
25 |
echo "$1" >&2 |
|
26 |
exit 2 |
|
27 |
} |
|
28 |
||
29 |
||
30 |
## main |
|
31 |
||
32 |
mkdir -p "$LOGDIR" || fail "Bad log directory: $LOGDIR" |
|
33 |
||
34 |
[ -z "$ISABELLE_HOME" -o -z "$ISABELLE_TOOL" ] && fail "Bad Isabelle environment" |
|
35 |
||
36 |
cd "$ISABELLE_HOME" |
|
37 |
||
38 |
hg pull -u || fail "Bad repository: $PWD" |
|
39 |
IDENT="$(hg parent --template "{node|short}")" |
|
40 |
||
41 |
( |
|
42 |
ulimit -t "$MAXTIME" |
|
43 |
||
44 |
echo -n "hg id: "; hg id |
|
45 |
"$ISABELLE_TOOL" makeall clean |
|
46 |
"$ISABELLE_TOOL" makeall all -k |
|
47 |
exit "$?" |
|
48 |
) > "$LOG" 2>&1 |
|
49 |
||
50 |
if [ "$?" -eq 0 ]; then |
|
51 |
[ -x "$PUBLISH_TEST" ] && \ |
|
52 |
"$PUBLISH_TEST" -r "$IDENT" -s SUCCESS -a log "$LOG" -n "$TEST_NAME" |
|
53 |
gzip -f "$LOG" |
|
54 |
else |
|
55 |
[ -x "$PUBLISH_TEST" ] && \ |
|
56 |
"$PUBLISH_TEST" -r "$IDENT" -s FAIL -a log "$LOG" -n "$TEST_NAME" |
|
57 |
fail "Minimal test failed, see $LOG" |
|
58 |
fi |
|
59 |