#! /bin/sh
# This test script validates all *.html files as XHTML.
set -eu
e=0
fail=
IFS=$(printf '\n\t')
# smoke test validator and skip if it fails
cat - <<'_EOF' | xmllint 2>/dev/null --nonet --postvalid --noout - || exit 77
_EOF
# same, for XHTML 1.1
cat - <<'_EOF' | xmllint 2>/dev/null --nonet --postvalid --noout - || exit 77
_EOF
for i in "${srcdir}"/*.html ; do
case "$i" in */fetchmail-man.html) continue ;; esac
xmllint --postvalid --noout "$i" || { e=1 ; fail="$i${fail:+" "}$fail" ; }
done
if [ $e != 0 ] ; then
echo >&2 ">>>>> Invalid XHTML in files: ${fail}."
fi
exit $e