blob: 6d9ede6194105bc106216e125a32fa49e77f6143 [file] [log] [blame]
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001From ea1993d1d9a18c5e61b9cb271892b0a48f508d32 Mon Sep 17 00:00:00 2001
Brad Bishop6e60e8b2018-02-01 10:27:11 -05002From: 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---
William A. Kennington IIIac69b482021-06-02 12:28:27 -070012 Makefile.am | 2 +-
13 python/Makefile.am | 9 +++++++++
14 python/tests/Makefile.am | 10 ++++++++++
15 3 files changed, 20 insertions(+), 1 deletion(-)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050016
Andrew Geissler82c905d2020-04-13 13:39:40 -050017diff --git a/Makefile.am b/Makefile.am
William A. Kennington IIIac69b482021-06-02 12:28:27 -070018index b428452b..dc18d6dd 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050019--- a/Makefile.am
20+++ b/Makefile.am
21@@ -203,9 +203,9 @@ install-ptest:
Brad Bishop316dfdd2018-06-25 12:45:53 -040022 install $(check_PROGRAMS) $(DESTDIR))
Brad Bishop6e60e8b2018-02-01 10:27:11 -050023 cp -r $(srcdir)/test $(DESTDIR)
24 cp -r $(srcdir)/result $(DESTDIR)
25- cp -r $(srcdir)/python $(DESTDIR)
26 cp Makefile $(DESTDIR)
27 sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
28+ $(MAKE) -C python install-ptest
29
Brad Bishop316dfdd2018-06-25 12:45:53 -040030 runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
31 testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
Andrew Geissler82c905d2020-04-13 13:39:40 -050032diff --git a/python/Makefile.am b/python/Makefile.am
William A. Kennington IIIac69b482021-06-02 12:28:27 -070033index 34aed96c..ba3ec6a4 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050034--- a/python/Makefile.am
35+++ b/python/Makefile.am
36@@ -48,7 +48,16 @@ GENERATED = libxml2class.py libxml2class.txt $(BUILT_SOURCES)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037
38 $(GENERATED): $(srcdir)/generator.py $(API_DESC)
39 $(PYTHON) $(srcdir)/generator.py $(srcdir)
40+
41+install-ptest:
42+ cp -r $(srcdir) $(DESTDIR)
43+ sed -e 's|^Makefile:|_Makefile:|' \
44+ -e 's|^\(tests test:\) all|\1|' Makefile >$(DESTDIR)/python/Makefile
45+ $(MAKE) -C tests install-ptest
46+else
47+install-ptest:
48 endif
49
50+.PHONY: tests test
51 tests test: all
52 cd tests && $(MAKE) tests
Andrew Geissler82c905d2020-04-13 13:39:40 -050053diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am
William A. Kennington IIIac69b482021-06-02 12:28:27 -070054index 227e24df..3568c2d2 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050055--- a/python/tests/Makefile.am
56+++ b/python/tests/Makefile.am
Brad Bishop6e60e8b2018-02-01 10:27:11 -050057@@ -59,6 +59,11 @@ XMLS= \
58 CLEANFILES = core tmp.xml *.pyc
59
60 if WITH_PYTHON
61+install-ptest:
62+ cp -r $(srcdir) $(DESTDIR)/python
63+ sed -e 's|^Makefile:|_Makefile:|' \
64+ -e 's|^\(srcdir = \).*|\1.|' Makefile >$(DESTDIR)/python/tests/Makefile
65+
66 tests: $(PYTESTS)
67 @for f in $(XMLS) ; do test -f $$f || $(LN_S) $(srcdir)/$$f . ; done
68 @echo "## running Python regression tests"
Andrew Geissler82c905d2020-04-13 13:39:40 -050069@@ -70,9 +75,14 @@ tests: $(PYTESTS)
70 if [ "$$?" -ne 0 ] ; then \
71 echo "-- $$test" ; \
72 echo "$$log" ; \
73+ echo "FAIL: $$test"; \
74 exit 1 ; \
75+ else \
76+ echo "PASS: $$test"; \
77 fi ; \
78 done)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050079 else
80+install-ptest:
81+
82 tests:
83 endif
William A. Kennington IIIac69b482021-06-02 12:28:27 -070084--
852.25.1
86