#!/bin/sh

set -e

LOG="-l /dev/stderr"

if [ -z $AUTOPKGTEST_TMP ]; then
    # The script is invoked from the override_dh_auto_test target.
    PARSER=src/targets/cgi/parser3
    DIR=debian/examples
    CONF="-f etc/auto.p"
else
    PARSER=parser3
    DIR=/usr/share/doc/parser3-common/examples
fi

# The exit status of parser3 is always zero.
$PARSER $LOG $CONF $DIR/index.en.html | grep --quiet "If you see this page"
