aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-02-18 14:32:39 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-02-18 14:32:39 +0000
commit55253e21f0f41f03afb4842f560a852658077a89 (patch)
treecdb6108a778a0dc3aa011d4395b67b18c3f7adcf
parent2875770e5301f96c4c7bf576d611613cf912b632 (diff)
downloadandroid_external_libxml2-55253e21f0f41f03afb4842f560a852658077a89.tar.gz
android_external_libxml2-55253e21f0f41f03afb4842f560a852658077a89.tar.bz2
android_external_libxml2-55253e21f0f41f03afb4842f560a852658077a89.zip
fixed the test script after some discussion on the semantic of
* check-xml-test-suite.py: fixed the test script after some discussion on the semantic of TYPE="error" * Makefile.am: added the script to the distrib Daniel
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.am4
-rwxr-xr-xcheck-xml-test-suite.py33
3 files changed, 39 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 70c5ce95..afbbf14e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Feb 18 15:30:14 CET 2002 Daniel Veillard <daniel@veillard.com>
+
+ * check-xml-test-suite.py: fixed the test script after some discussion
+ on the semantic of TYPE="error"
+ * Makefile.am: added the script to the distrib
+
Mon Feb 18 12:17:41 CET 2002 Daniel Veillard <daniel@veillard.com>
* SAX.c entities.c: fixed a couple of conformances issues deep
diff --git a/Makefile.am b/Makefile.am
index 0512f7e7..b16d7587 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -551,7 +551,7 @@ dist-hook: libxml.spec
(cd $(srcdir) ; tar -cf - --exclude CVS win32 macos vms test result SAXresult ) | (cd $(distdir); tar xf -)
cleantar:
- @(rm -f libxslt*.tar.gz COPYING.LIB)
+ @(rm -f libxml*.tar.gz COPYING.LIB)
rpm: cleantar
@(unset CDPATH ; $(MAKE) dist && rpm -ta $(distdir).tar.gz)
@@ -566,7 +566,7 @@ CLEANFILES=xml2Conf.sh
confexecdir=$(libdir)
confexec_DATA = xml2Conf.sh
EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml.spec \
- libxml.m4 Copyright \
+ libxml.m4 Copyright check-xml-test-suite.py \
example/Makefile.am example/gjobread.c example/gjobs.xml \
$(man_MANS) libxml-2.0.pc.in \
trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
diff --git a/check-xml-test-suite.py b/check-xml-test-suite.py
index 83546e48..248367d4 100755
--- a/check-xml-test-suite.py
+++ b/check-xml-test-suite.py
@@ -22,7 +22,8 @@ def errorHandler(ctx, str):
global error_nr
global error_msg
- error_nr = error_nr + 1
+ if string.find(str, "error:") >= 0:
+ error_nr = error_nr + 1
if len(error_msg) < 300:
if len(error_msg) == 0 or error_msg[-1] == '\n':
error_msg = error_msg + " >>" + str
@@ -155,6 +156,34 @@ def testWfEntDtd(filename, id):
doc.freeDoc()
return 1
+def testError(filename, id):
+ global error_nr
+ global error_msg
+ global log
+
+ error_nr = 0
+ error_msg = ''
+
+ ctxt = libxml2.createFileParserCtxt(filename)
+ if ctxt == None:
+ return -1
+ ctxt.replaceEntities(1)
+ ctxt.loadSubset(1)
+ ctxt.parseDocument()
+
+ doc = ctxt.doc()
+ if ctxt.wellFormed() == 0:
+ print "%s: warning: failed to parse the document but accepted" % (id)
+ log.write("%s: warning: failed to parse the document but accepte\n" % (id))
+ return 2
+ if error_nr != 0:
+ print "%s: warning: WF document generated an error msg" % (id)
+ log.write("%s: error: WF document generated an error msg\n" % (id))
+ doc.freeDoc()
+ return 2
+ doc.freeDoc()
+ return 1
+
def testInvalid(filename, id):
global error_nr
global error_msg
@@ -271,7 +300,7 @@ def runTest(test):
# print "Unknow value %s for an ENTITIES test value" % (extra)
# return -1
elif type == "error":
- res = testWfEntDtd(URI, id)
+ res = testError(URI, id)
else:
# TODO skipped for now
return -1