summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch')
-rw-r--r--meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch98
1 files changed, 0 insertions, 98 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
deleted file mode 100644
index 5e9a0a506b..0000000000
--- a/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch
+++ /dev/null
@@ -1,98 +0,0 @@
1From 2b5fb416aa275fd2a17a0139a2f783998bcb42cc 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---
13 Makefile.am | 2 +-
14 python/Makefile.am | 9 +++++++++
15 python/tests/Makefile.am | 10 ++++++++++
16 python/tests/tstLastError.py | 2 +-
17 4 files changed, 21 insertions(+), 2 deletions(-)
18
19diff --git a/Makefile.am b/Makefile.am
20index ae62274..bd1e425 100644
21--- a/Makefile.am
22+++ b/Makefile.am
23@@ -203,9 +203,9 @@ install-ptest:
24 install $(check_PROGRAMS) $(DESTDIR))
25 cp -r $(srcdir)/test $(DESTDIR)
26 cp -r $(srcdir)/result $(DESTDIR)
27- cp -r $(srcdir)/python $(DESTDIR)
28 cp Makefile $(DESTDIR)
29 sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
30+ $(MAKE) -C python install-ptest
31
32 runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
33 testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
34diff --git a/python/Makefile.am b/python/Makefile.am
35index 34aed96..ba3ec6a 100644
36--- a/python/Makefile.am
37+++ b/python/Makefile.am
38@@ -48,7 +48,16 @@ GENERATED = libxml2class.py libxml2class.txt $(BUILT_SOURCES)
39
40 $(GENERATED): $(srcdir)/generator.py $(API_DESC)
41 $(PYTHON) $(srcdir)/generator.py $(srcdir)
42+
43+install-ptest:
44+ cp -r $(srcdir) $(DESTDIR)
45+ sed -e 's|^Makefile:|_Makefile:|' \
46+ -e 's|^\(tests test:\) all|\1|' Makefile >$(DESTDIR)/python/Makefile
47+ $(MAKE) -C tests install-ptest
48+else
49+install-ptest:
50 endif
51
52+.PHONY: tests test
53 tests test: all
54 cd tests && $(MAKE) tests
55diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am
56index 227e24d..021bb29 100644
57--- a/python/tests/Makefile.am
58+++ b/python/tests/Makefile.am
59@@ -59,6 +59,11 @@ XMLS= \
60 CLEANFILES = core tmp.xml *.pyc
61
62 if WITH_PYTHON
63+install-ptest:
64+ cp -r $(srcdir) $(DESTDIR)/python
65+ sed -e 's|^Makefile:|_Makefile:|' \
66+ -e 's|^\(srcdir = \).*|\1.|' Makefile >$(DESTDIR)/python/tests/Makefile
67+
68 tests: $(PYTESTS)
69 @for f in $(XMLS) ; do test -f $$f || $(LN_S) $(srcdir)/$$f . ; done
70 @echo "## running Python regression tests"
71@@ -70,9 +75,14 @@ tests: $(PYTESTS)
72 if [ "$$?" -ne 0 ] ; then \
73 echo "-- $$test" ; \
74 echo "$$log" ; \
75+ echo "FAIL: $$test"; \
76 exit 1 ; \
77+ else \
78+ echo "PASS: $$test"; \
79 fi ; \
80 done)
81 else
82+install-ptest:
83+
84 tests:
85 endif
86diff --git a/python/tests/tstLastError.py b/python/tests/tstLastError.py
87index 81d0acc..162c8db 100755
88--- a/python/tests/tstLastError.py
89+++ b/python/tests/tstLastError.py
90@@ -25,7 +25,7 @@ class TestCase(unittest.TestCase):
91 when the exception is raised, check the libxml2.lastError for
92 expected values."""
93 # disable the default error handler
94- libxml2.registerErrorHandler(None,None)
95+ libxml2.registerErrorHandler(lambda ctx,str: None,None)
96 try:
97 f(*args)
98 except exc: