chiark / gitweb /
merge finalisation of 1.0.9
[autopkgtest.git] / runner / adt-testreport-runloop
1 #!/bin/bash
2
3 set -e
4
5 max_test_count=10
6 go_anyway=false
7
8 for arg in "$@"; do
9         case "$arg" in
10         !*)     arg="${arg#!}" ;;
11         *)      onepackage_args[${#onepackage_args[*]}]="${arg#@}" ;;
12         esac
13
14         case "$arg" in
15         @*)                     ;;
16         *=*)    eval "$arg"     ;;
17         *)      . "$arg"        ;;
18         esac
19 done
20
21 if [ "x$distro" = x ]; then
22         : ${testbed_check_path:=/var/lib/autopkgtest/xenlvm/adt_${distro}/good}
23 else
24         : ${testbed_check_path:=/dev/null}
25 fi
26
27 if [ "x$test_classes" = x]; then
28         : ${architecture:=`dpkg --print-architecture`}
29         test_classes="source $distro, target=source : binary $distro, target=binary-$architecture"
30 fi
31
32 fail () { printf >&2 "%s\n" "$*"; exit 127; }
33 progress () { printf "========== %s ==========\n" "$1"; }
34 x () { printf "+ %s\n" "$*"; "$@"; }
35 x2 () { printf >&2 "+ %s\n" "$*"; "$@"; }
36
37 progress testing
38
39 test_count=0
40
41 while ($go_anyway || test -f go) && test $test_count -lt $max_test_count; do
42         now=`date`
43         printf "%s" "$now: "
44
45         if ! test -e $testbed_check_path; then
46                 printf " testbed broken, bailing\n"
47                 break
48         fi
49
50         xopts="${test_classes%%:*}"
51         xopts_opts="${xopts#*,}"
52         test_classes="${test_classes#*:}:$xopts"
53         printf "considering (%s) " "$xopts_opts"
54
55         anybroken=false
56         for x in ${xopts%%,*}; do
57                 if test -f "stop-$x"; then
58                         printf "   skipping because of %s" "$x"
59                         anybroken=true
60                         break
61                 fi
62         done
63         if $anybroken; then
64                 printf "\n"
65                 continue
66         fi
67
68         adt-testreport-onepackage                               \
69                 adtrun_extra_opts=--built-binaries-filter=__    \
70                 interactive=false                               \
71                 "${onepackage_args[@]}"                         \
72                 $xopts_opts
73
74         test_count=$(( $test_count + 1 ))
75 done
76
77 progress 'stopping'