#!/bin/bash
#
#  This script expects to be given at least two arguments:
#     directory to cd to
#     main config file for adt-testreport-runloop which sets PATH if need be
#     remaining arguments are passed through to a-t-r unchanged

set -e
echo "The adt-testreport-* scripts are unmaintained and deprecated in favor of" >&2
echo "http://ci.debian.net, debci, and/or jenkins. They will go away soon if " >&2
echo "nobody uses them any more; so if you still do, please mail " >&2
echo "autopkgtest-devel@lists.alioth.debian.org. Thanks!" >&2

cd "$1"
shift
. "$1"
exec >>var/overall.log 2>&1
${ADT_GO_ANYWAY:-false} || test -f go
with-lock-ex -q cronjob-lock \
 adt-testreport-runloop max_test_count=100 "$@"
