William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 1 | From ea1993d1d9a18c5e61b9cb271892b0a48f508d32 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 2 | From: Peter Kjellerstedt <pkj@axis.com> |
| 3 | Date: Fri, 9 Jun 2017 17:50:46 +0200 |
| 4 | Subject: [PATCH] Make ptest run the python tests if python is enabled |
| 5 | |
| 6 | One of the tests (tstLastError.py) needed a minor correction. It might |
| 7 | be due to the fact that the tests are forced to run with Python 3. |
| 8 | |
| 9 | Upstream-Status: Inappropriate [OE specific] |
| 10 | Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> |
| 11 | --- |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 12 | Makefile.am | 2 +- |
| 13 | python/Makefile.am | 9 +++++++++ |
| 14 | python/tests/Makefile.am | 10 ++++++++++ |
| 15 | 3 files changed, 20 insertions(+), 1 deletion(-) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 16 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 17 | diff --git a/Makefile.am b/Makefile.am |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 18 | index b428452b..dc18d6dd 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 19 | --- a/Makefile.am |
| 20 | +++ b/Makefile.am |
| 21 | @@ -203,9 +203,9 @@ install-ptest: |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 22 | install $(check_PROGRAMS) $(DESTDIR)) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 23 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 30 | runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \ |
| 31 | testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 32 | diff --git a/python/Makefile.am b/python/Makefile.am |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 33 | index 34aed96c..ba3ec6a4 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 34 | --- a/python/Makefile.am |
| 35 | +++ b/python/Makefile.am |
| 36 | @@ -48,7 +48,16 @@ GENERATED = libxml2class.py libxml2class.txt $(BUILT_SOURCES) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 37 | |
| 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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 53 | diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 54 | index 227e24df..3568c2d2 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 55 | --- a/python/tests/Makefile.am |
| 56 | +++ b/python/tests/Makefile.am |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 57 | @@ -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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 69 | @@ -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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 79 | else |
| 80 | +install-ptest: |
| 81 | + |
| 82 | tests: |
| 83 | endif |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 84 | -- |
| 85 | 2.25.1 |
| 86 | |