summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 ea0d3b88af..4f60781d22 100644
--- a/meta/recipes-core/libxml/libxml2_2.9.4.bb
+++ b/meta/recipes-core/libxml/libxml2_2.9.4.bb
@@ -24,7 +24,8 @@ SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz;name=libtar \
24 file://libxml2-CVE-2016-4658.patch \ 24 file://libxml2-CVE-2016-4658.patch \
25 file://libxml2-fix_NULL_pointer_derefs.patch \ 25 file://libxml2-fix_NULL_pointer_derefs.patch \
26 file://CVE-2016-9318.patch \ 26 file://CVE-2016-9318.patch \
27 " 27 file://0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch \
28 "
28 29
29SRC_URI[libtar.md5sum] = "ae249165c173b1ff386ee8ad676815f5" 30SRC_URI[libtar.md5sum] = "ae249165c173b1ff386ee8ad676815f5"
30SRC_URI[libtar.sha256sum] = "ffb911191e509b966deb55de705387f14156e1a56b21824357cdf0053233633c" 31SRC_URI[libtar.sha256sum] = "ffb911191e509b966deb55de705387f14156e1a56b21824357cdf0053233633c"
@@ -43,7 +44,7 @@ inherit autotools pkgconfig binconfig-disabled ptest
43 44
44inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} 45inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)}
45 46
46RDEPENDS_${PN}-ptest += "make ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}" 47RDEPENDS_${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)}"
47 48
48RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}" 49RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}"
49 50
@@ -77,6 +78,12 @@ do_configure_prepend () {
77 78
78do_install_ptest () { 79do_install_ptest () {
79 cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH} 80 cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH}
81 if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then
82 sed -i -e 's|^\(PYTHON = \).*|\1${USRBINPATH}/${PYTHON_PN}|' \
83 ${D}${PTEST_PATH}/python/tests/Makefile
84 grep -lrZ '#!/usr/bin/python' ${D}${PTEST_PATH}/python |
85 xargs -0 sed -i -e 's|/usr/bin/python|${USRBINPATH}/${PYTHON_PN}|'
86 fi
80} 87}
81 88
82do_install_append_class-native () { 89do_install_append_class-native () {