#!/bin/sh
#
# Check if the program is running and produce expected output.

set -e

retval=0

error() { retval=1; echo "error:" "$@"; }

testcaldav --stop > "$AUTOPKGTEST_TMP/run.log" 2>&1 || true

if grep -q scripts.tests "$AUTOPKGTEST_TMP/run.log"; then
    echo "success: running testcaldav seem to work"
else
    error "output from testcaldav was not as expected"
fi

cat "$AUTOPKGTEST_TMP/run.log"

exit $retval
