From a6de5fa28fc90e0184d3d86822d06de5d93bbc44 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Thu, 8 Dec 2022 12:10:39 +0000 Subject: libxml2: add more testing Backport more test cases fixes from upstream, and add runsuite to the ptests. Signed-off-by: Ross Burton Signed-off-by: Alexandre Belloni --- meta/recipes-core/libxml/libxml2/fix-tests.patch | 222 +++++++++++++++++++++++ meta/recipes-core/libxml/libxml2/run-ptest | 2 +- meta/recipes-core/libxml/libxml2_2.10.3.bb | 1 + 3 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-core/libxml/libxml2/fix-tests.patch (limited to 'meta') diff --git a/meta/recipes-core/libxml/libxml2/fix-tests.patch b/meta/recipes-core/libxml/libxml2/fix-tests.patch new file mode 100644 index 0000000000..80678efcfe --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/fix-tests.patch @@ -0,0 +1,222 @@ +Backport the following patches to fix the reader2 and runsuite test cases: + +b92768cd tests: Enable "runsuite" test +0ac8c15e python/tests/reader2: use absolute paths everywhere +b9ba5e1d python/tests/reader2: always exit(1) if a test fails + +Upstream-Status: Backport +Signed-off-by: Ross Burton + +diff --git a/python/tests/reader2.py b/python/tests/reader2.py +index 65cecd47..6e6353b4 100755 +--- a/python/tests/reader2.py ++++ b/python/tests/reader2.py +@@ -6,7 +6,6 @@ + import sys + import glob + import os +-import string + import libxml2 + try: + import StringIO +@@ -20,103 +19,104 @@ libxml2.debugMemory(1) + + err = "" + basedir = os.path.dirname(os.path.realpath(__file__)) +-dir_prefix = os.path.join(basedir, "../../test/valid/") ++dir_prefix = os.path.realpath(os.path.join(basedir, "..", "..", "test", "valid")) ++ + # This dictionary reflects the contents of the files + # ../../test/valid/*.xml.err that are not empty, except that + # the file paths in the messages start with ../../test/ + + expect = { + '766956': +-"""../../test/valid/dtds/766956.dtd:2: parser error : PEReference: expecting ';' ++"""{0}/dtds/766956.dtd:2: parser error : PEReference: expecting ';' + %ä%ent; + ^ +-../../test/valid/dtds/766956.dtd:2: parser error : Content error in the external subset ++{0}/dtds/766956.dtd:2: parser error : Content error in the external subset + %ä%ent; + ^ + Entity: line 1: + value + ^ +-""", ++""".format(dir_prefix), + '781333': +-"""../../test/valid/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got ++"""{0}/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got + + ^ +-../../test/valid/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more child ++{0}/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more child + + ^ +-""", ++""".format(dir_prefix), + 'cond_sect2': +-"""../../test/valid/dtds/cond_sect2.dtd:15: parser error : All markup of the conditional section is not in the same entity ++"""{0}/dtds/cond_sect2.dtd:15: parser error : All markup of the conditional section is not in the same entity + %ent; + ^ + Entity: line 1: + ]]> + ^ +-../../test/valid/dtds/cond_sect2.dtd:17: parser error : Content error in the external subset ++{0}/dtds/cond_sect2.dtd:17: parser error : Content error in the external subset + + ^ +-""", ++""".format(dir_prefix), + 'rss': +-"""../../test/valid/rss.xml:177: element rss: validity error : Element rss does not carry attribute version ++"""{0}/rss.xml:177: element rss: validity error : Element rss does not carry attribute version + + ^ +-""", ++""".format(dir_prefix), + 't8': +-"""../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration ++"""{0}/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration + + %defroot; %defmiddle; %deftest; + ^ + Entity: line 1: + <!ELEMENT root (middle) > + ^ +-../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration ++{0}/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration + + %defroot; %defmiddle; %deftest; + ^ + Entity: line 1: + <!ELEMENT middle (test) > + ^ +-../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration ++{0}/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration + + %defroot; %defmiddle; %deftest; + ^ + Entity: line 1: + <!ELEMENT test (#PCDATA) > + ^ +-""", ++""".format(dir_prefix), + 't8a': +-"""../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration ++"""{0}/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration + + %defroot;%defmiddle;%deftest; + ^ + Entity: line 1: + <!ELEMENT root (middle) > + ^ +-../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration ++{0}/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration + + %defroot;%defmiddle;%deftest; + ^ + Entity: line 1: + <!ELEMENT middle (test) > + ^ +-../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration ++{0}/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration + + %defroot;%defmiddle;%deftest; + ^ + Entity: line 1: + <!ELEMENT test (#PCDATA) > + ^ +-""", ++""".format(dir_prefix), + 'xlink': +-"""../../test/valid/xlink.xml:450: element termdef: validity error : ID dt-arc already defined ++"""{0}/xlink.xml:450: element termdef: validity error : ID dt-arc already defined +

An