]> Pileus Git - ~andy/fetchmail/commitdiff
Validate XHTML 1.0 stuff even when skipping 1.1.
authorMatthias Andree <matthias.andree@gmx.de>
Sun, 1 Apr 2012 13:33:49 +0000 (15:33 +0200)
committerMatthias Andree <matthias.andree@gmx.de>
Sun, 1 Apr 2012 13:34:54 +0000 (15:34 +0200)
Makefile.am
t.validate-xhtml
t.validate-xhtml10 [new file with mode: 0755]

index 02f4da768968b7b4b1b4829d32bbce5ce8b3ae02..129d0be39cb66e313b4ab196d9edf3512e1de28c 100644 (file)
@@ -50,7 +50,7 @@ DEPENDENCIES=         libfm.a $(LIBOBJS)
 
 check_PROGRAMS=
 
-TESTS=                 t.smoke t.validate-xhtml t.x509_name_match
+TESTS=                 t.smoke t.validate-xhtml10 t.validate-xhtml t.x509_name_match
 TESTS_ENVIRONMENT=     srcdir="$(srcdir)" LC_ALL=C TZ=UTC SHELL="$(SHELL)" $(SHELL)
 
 if NEED_TRIO
index 79649481c67e9dcb6dabc5aa965e3d3084139e89..8eeafcc699cdcb95a8dc9bb9825755215afb04f8 100755 (executable)
@@ -7,13 +7,6 @@ e=0
 fail=
 IFS=$(printf '\n\t')
 
-# smoke test validator for XHTML 1.0 Transitional, and skip if it fails
-cat - <<'_EOF'  | xmllint 2>/dev/null --nonet --postvalid --noout - || exit 77
-<?xml version="1.0" encoding="US-ASCII"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-    <head><title /></head><body></body></html>
-_EOF
 # ditto for XHTML 1.1 (asciidoc generates that)
 cat - <<'_EOF'  | xmllint 2>/dev/null --nonet --postvalid --noout - || exit 77
 <?xml version="1.0" encoding="US-ASCII"?>
@@ -24,8 +17,8 @@ _EOF
 
 for i in "${srcdir}"/*.html ; do
     case "$i" in
-       */fetchmail-man.html) continue ;;
-#      */Mailbox-Names-UTF7.html) continue ;;
+       */Mailbox-Names-UTF7.html) ;;
+       *)                         continue ;;
     esac
     xmllint --postvalid --noout "$i" || { e=1 ; fail="$i${fail:+" "}$fail" ; }
 done
diff --git a/t.validate-xhtml10 b/t.validate-xhtml10
new file mode 100755 (executable)
index 0000000..a7cc9e6
--- /dev/null
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+# This test script validates all *.html files as XHTML.
+
+set -eu
+e=0
+fail=
+IFS=$(printf '\n\t')
+
+# smoke test validator for XHTML 1.0 Transitional, and skip if it fails
+cat - <<'_EOF'  | xmllint 2>/dev/null --nonet --postvalid --noout - || exit 77
+<?xml version="1.0" encoding="US-ASCII"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head><title /></head><body></body></html>
+_EOF
+
+for i in "${srcdir}"/*.html ; do
+    case "$i" in
+       */fetchmail-man.html) continue ;;
+       */Mailbox-Names-UTF7.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