summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/libxml
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/libxml')
-rw-r--r--meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch99
-rw-r--r--meta/recipes-core/libxml/libxml2_2.9.4.bb11
2 files changed, 108 insertions, 2 deletions
diff --git a/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch b/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch
new file mode 100644
index 0000000000..d1ad55116a
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch
@@ -0,0 +1,99 @@
1From 78dbd4c09d617a9cb730d796f94ee4d93840d3cc Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Fri, 9 Jun 2017 17:50:46 +0200
4Subject: [PATCH] Make ptest run the python tests if python is enabled
5
6One of the tests (tstLastError.py) needed a minor correction. It might
7be due to the fact that the tests are forced to run with Python 3.
8
9Upstream-Status: Inappropriate [OE specific]
10Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
11---
12 Makefile.am | 2 +-
13 python/Makefile.am | 9 +++++++++
14 python/tests/Makefile.am | 12 ++++++++++--
15 python/tests/tstLastError.py | 2 +-
16 4 files changed, 21 insertions(+), 4 deletions(-)
17
18diff --git a/Makefile.am b/Makefile.am
19index e181ee0..7960e7d 100644
20--- a/Makefile.am
21+++ b/Makefile.am
22@@ -207,9 +207,9 @@ install-ptest:
23 install $(noinst_PROGRAMS) $(DESTDIR))
24 cp -r $(srcdir)/test $(DESTDIR)
25 cp -r $(srcdir)/result $(DESTDIR)
26- cp -r $(srcdir)/python $(DESTDIR)
27 cp Makefile $(DESTDIR)
28 sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
29+ $(MAKE) -C python install-ptest
30
31 runtests:
32 [ -d test ] || $(LN_S) $(srcdir)/test .
33diff --git a/python/Makefile.am b/python/Makefile.am
34index 34aed96..ba3ec6a 100644
35--- a/python/Makefile.am
36+++ b/python/Makefile.am
37@@ -48,7 +48,16 @@ GENERATED = libxml2class.py libxml2class.txt $(BUILT_SOURCES)
38
39 $(GENERATED): $(srcdir)/generator.py $(API_DESC)
40 $(PYTHON) $(srcdir)/generator.py $(srcdir)
41+
42+install-ptest:
43+ cp -r $(srcdir) $(DESTDIR)
44+ sed -e 's|^Makefile:|_Makefile:|' \
45+ -e 's|^\(tests test:\) all|\1|' Makefile >$(DESTDIR)/python/Makefile
46+ $(MAKE) -C tests install-ptest
47+else
48+install-ptest:
49 endif
50
51+.PHONY: tests test
52 tests test: all
53 cd tests && $(MAKE) tests
54diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am
55index 95ebead..418e21e 100644
56--- a/python/tests/Makefile.am
57+++ b/python/tests/Makefile.am
58@@ -59,6 +59,11 @@ XMLS= \
59 CLEANFILES = core tmp.xml *.pyc
60
61 if WITH_PYTHON
62+install-ptest:
63+ cp -r $(srcdir) $(DESTDIR)/python
64+ sed -e 's|^Makefile:|_Makefile:|' \
65+ -e 's|^\(srcdir = \).*|\1.|' Makefile >$(DESTDIR)/python/tests/Makefile
66+
67 tests: $(PYTESTS)
68 @for f in $(XMLS) ; do test -f $$f || $(LN_S) $(srcdir)/$$f . ; done
69 @echo "## running Python regression tests"
70@@ -68,8 +73,11 @@ tests: $(PYTESTS)
71 export LD_LIBRARY_PATH; \
72 for test in $(PYTESTS) ; \
73 do log=`$(PYTHON) $(srcdir)/$$test` ; \
74- if [ "`echo $$log | grep OK`" = "" ] ; then \
75- echo "-- $$test" ; echo "$$log" ; fi ; done)
76+ if [ "`echo $$log | grep OK`" ]; then \
77+ echo "PASS: $$test"; else \
78+ echo "$$log"; echo "FAIL: $$test"; fi; done)
79 else
80+install-ptest:
81+
82 tests:
83 endif
84diff --git a/python/tests/tstLastError.py b/python/tests/tstLastError.py
85index d5f9be7..3e5bef8 100755
86--- a/python/tests/tstLastError.py
87+++ b/python/tests/tstLastError.py
88@@ -25,7 +25,7 @@ class TestCase(unittest.TestCase):
89 when the exception is raised, check the libxml2.lastError for
90 expected values."""
91 # disable the default error handler
92- libxml2.registerErrorHandler(None,None)
93+ libxml2.registerErrorHandler(lambda ctx,str: None,None)
94 try:
95 f(*args)
96 except exc:
97--
982.12.0
99
diff --git a/meta/recipes-core/libxml/libxml2_2.9.4.bb b/meta/recipes-core/libxml/libxml2_2.9.4.bb
index 4de88d39a4..677d8c9bb5 100644
--- a/meta/recipes-core/libxml/libxml2_2.9.4.bb
+++ b/meta/recipes-core/libxml/libxml2_2.9.4.bb
@@ -29,7 +29,8 @@ SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz;name=libtar \
29 file://libxml2-CVE-2017-5969.patch \ 29 file://libxml2-CVE-2017-5969.patch \
30 file://libxml2-CVE-2017-0663.patch \ 30 file://libxml2-CVE-2017-0663.patch \
31 file://CVE-2016-9318.patch \ 31 file://CVE-2016-9318.patch \
32 " 32 file://0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch \
33 "
33 34
34SRC_URI[libtar.md5sum] = "ae249165c173b1ff386ee8ad676815f5" 35SRC_URI[libtar.md5sum] = "ae249165c173b1ff386ee8ad676815f5"
35SRC_URI[libtar.sha256sum] = "ffb911191e509b966deb55de705387f14156e1a56b21824357cdf0053233633c" 36SRC_URI[libtar.sha256sum] = "ffb911191e509b966deb55de705387f14156e1a56b21824357cdf0053233633c"
@@ -48,7 +49,7 @@ inherit autotools pkgconfig binconfig-disabled ptest
48 49
49inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} 50inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)}
50 51
51RDEPENDS_${PN}-ptest += "make ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}" 52RDEPENDS_${PN}-ptest += "make ${@bb.utils.contains('PACKAGECONFIG', 'python', 'libgcc python3-core python3-argparse python3-logging python3-shell python3-signal python3-stringold python3-threading python3-unittest ${PN}-python', '', d)}"
52 53
53RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}" 54RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}"
54 55
@@ -82,6 +83,12 @@ do_configure_prepend () {
82 83
83do_install_ptest () { 84do_install_ptest () {
84 cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH} 85 cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH}
86 if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then
87 sed -i -e 's|^\(PYTHON = \).*|\1${USRBINPATH}/${PYTHON_PN}|' \
88 ${D}${PTEST_PATH}/python/tests/Makefile
89 grep -lrZ '#!/usr/bin/python' ${D}${PTEST_PATH}/python |
90 xargs -0 sed -i -e 's|/usr/bin/python|${USRBINPATH}/${PYTHON_PN}|'
91 fi
85} 92}
86 93
87do_install_append_class-native () { 94do_install_append_class-native () {