From patchwork Thu Dec 8 12:10:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 16530 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6F5BC4332F for ; Thu, 8 Dec 2022 12:10:45 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.11729.1670501442329859308 for ; Thu, 08 Dec 2022 04:10:42 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A6B0723A; Thu, 8 Dec 2022 04:10:48 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 59AA73F73B; Thu, 8 Dec 2022 04:10:41 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH] libxml2: add more testing Date: Thu, 8 Dec 2022 12:10:39 +0000 Message-Id: <20221208121039.3507174-1-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 08 Dec 2022 12:10:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174401 Backport more test cases fixes from upstream, and add runsuite to the ptests. Signed-off-by: Ross Burton --- .../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 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 00000000000..80678efcfee --- /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