Skip to contentSkip to conversation

libxml++: fix ptests

PATCH New Gyorgy Sarvari 1 participant 2 messages Oct 31, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libxml++: fix ptests

The previous version installed the examples as ptests, not the actual tests.

This change compiles the tests on the build machine, install them, and execute them on the target machine.

---
 .../libxml/libxml++/libxml++_ptest.patch      | 78 -------------------
 .../recipes-core/libxml/libxml++/run-ptest    |  5 +-
 .../recipes-core/libxml/libxml++_2.42.1.bb    | 12 ++-
 3 files changed, 11 insertions(+), 84 deletions(-)
 delete mode 100644 meta-oe/recipes-core/libxml/libxml++/libxml++_ptest.patch
meta-oe/recipes-core/libxml/libxml++/libxml++_ptest.patch deleted +0 -78
deleted file mode 100644
index dc6198fe98..0000000000
@@ -1,78 +0,0 @@
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -40,5 +40,8 @@ EXTRA_DIST = \
-   tools/conf_tests/have_exception_ptr.cc \
-   untracked/README
- 
-+install-ptest:
-+	make -C examples install-ptest
-+
- # Optional: auto-generate the ChangeLog file from the git log on make dist
- include $(top_srcdir)/build/dist-changelog.am
---- a/examples/Makefile.am
-+++ b/examples/Makefile.am
-@@ -19,6 +19,8 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_
- AM_CXXFLAGS = $(LIBXMLXX_WXXFLAGS)
- LDADD = $(top_builddir)/libxml++/libxml++-$(LIBXMLXX_API_VERSION).la $(LIBXMLXX_LIBS)
- 
-+LOG_DRIVER = $(SHELL) ../macros/test-driver
-+
- check_PROGRAMS = \
-   dom_build/dom_build \
-   dom_parse_entities/dom_parse_entities \
-@@ -37,6 +39,23 @@ check_PROGRAMS = \
-   schemavalidation/schemavalidation \
-   textreader/textreader
- 
-+check_DOTLIBS = \
-+  dom_build/.libs/dom_build \
-+  dom_parse_entities/.libs/dom_parse_entities \
-+  dom_parser/.libs/dom_parser \
-+  dom_parser_raw/.libs/dom_parser_raw \
-+  dom_read_write/.libs/dom_read_write \
-+  dom_xinclude/.libs/dom_xinclude \
-+  dom_xpath/.libs/dom_xpath \
-+  dtdvalidation/.libs/dtdvalidation \
-+  import_node/.libs/import_node \
-+  sax_exception/.libs/sax_exception \
-+  sax_parser/.libs/sax_parser \
-+  sax_parser_build_dom/.libs/sax_parser_build_dom \
-+  sax_parser_entities/.libs/sax_parser_entities \
-+  schemavalidation/.libs/schemavalidation \
-+  textreader/.libs/textreader
-+
- # Shell scripts that call the example programs.
- check_SCRIPTS = \
-   dom_build/make_check.sh \
-@@ -154,10 +173,10 @@ dist_noinst_DATA = \
- # file are located in different directories.
- dom_read_write/make_check.sh: Makefile
- 	$(AM_V_GEN)echo '# Generated and used by "make check"' >$@
--	$(AM_V_at)echo 'dom_read_write/dom_read_write "$(srcdir)/dom_read_write/example.xml" dom_read_write/example_output.xml >/dev/null' >>$@
-+	$(AM_V_at)echo 'cd dom_read_write && .libs/dom_read_write "example.xml" example_output.xml >/dev/null' >>$@
- 	$(AM_V_at)chmod +x $@
- 
--script_template = cd "$(srcdir)/<!progname!>" && "$(abs_builddir)/<!progname!>/<!progname!>" >/dev/null
-+script_template = cd "<!progname!>" && ".libs/<!progname!>" >/dev/null
- standard_scripts = $(filter-out dom_read_write/make_check.sh,$(check_SCRIPTS))
- 
- # All other script files are generated like so:
-@@ -169,3 +188,18 @@ $(standard_scripts): Makefile
- CLEANFILES = \
-   dom_read_write/example_output.xml \
-   $(check_SCRIPTS)
-+
-+buildtest: all
-+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS)
-+	$(MAKE) $(AM_MAKEFLAGS) buildtest-TESTS
-+
-+install-ptest:
-+	$(MKDIR_P) $(DESTDIR)/examples
-+	cp --parents $(check_DOTLIBS) $(DESTDIR)/examples
-+	cp --parents $(check_SCRIPTS) $(DESTDIR)/examples
-+	cd $(srcdir) && cp --parents $(dist_noinst_DATA) $(DESTDIR)/examples
-+	cp Makefile $(DESTDIR)/examples
-+	$(MKDIR_P) $(DESTDIR)/macros
-+	cp $(top_srcdir)/build/test-driver $(DESTDIR)/macros
-+	sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/examples/Makefile
-+
meta-oe/recipes-core/libxml/libxml++/run-ptest +3 -2
index 236f667538..5e2d4177e2 100644
@@ -1,3 +1,4 @@
 #!/bin/sh
-cd examples
-make -k check-TESTS
+for t in tests/*; do
+  $t && echo PASS: $t || echo FAIL: $t
+done
meta-oe/recipes-core/libxml/libxml++_2.42.1.bb +8 -4
index f75568a1d9..412cc1ac21 100644
@@ -8,7 +8,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 "
 
 SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 SRC_URI = "${GNOME_MIRROR}/${BPN}/${SHRT_VER}/${BP}.tar.xz \
-    file://libxml++_ptest.patch \
     file://run-ptest \
 "
 SRC_URI[sha256sum] = "9b59059abe5545d28ceb388a55e341095f197bd219c73e6623aeb6d801e00be8"
@@ -24,10 +23,15 @@ do_configure:prepend() {
 }
 
 do_compile_ptest() {
-  oe_runmake -C examples buildtest
+  oe_runmake_call -C tests check || true
+}
+
+do_install_ptest() {
+  cd ${B}/tests
+  for t in *; do
+    [ -d $t ] && install -D $t/.libs/test ${D}${PTEST_PATH}/tests/$t
+  done
 }
 
 FILES:${PN}-doc += "${datadir}/devhelp"
 FILES:${PN}-dev += "${libdir}/libxml++-2.6/include/libxml++config.h"
-
-RDEPENDS:${PN}-ptest += "make"
#1 lore raw

PATCH 2/2 python3-aspectlib: fix ptests

Backport patch that adapts failing tests.

---
 .../0001-fix-failing-ptests.patch             | 54 +++++++++++++++++++
 .../python/python3-aspectlib_1.5.2.bb         |  1 +
 2 files changed, 55 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-aspectlib/0001-fix-failing-ptests.patch
meta-python/recipes-devtools/python/python3-aspectlib/0001-fix-failing-ptests.patch new file +54 -0
new file mode 100644
index 0000000000..8c07da67f0
@@ -0,0 +1,54 @@
+From 2b1e16fa9de6f444ed42c89b8d689e2607b6e358 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <[email protected]>
+Date: Sun, 19 Oct 2025 17:05:35 +0200
+Subject: [PATCH] fix failing ptests
+
+Some error messages in Python now include the classname also, so
+prepare the tests to expect these errors instead of the old version.
+
+This patch is the backport of a very small portion of this change:
+https://github.com/ionelmc/python-aspectlib/commit/ed4b036b9e69e195226faab719c470f77ad11cc2
+
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ tests/test_aspectlib_test.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tests/test_aspectlib_test.py b/tests/test_aspectlib_test.py
+index 05e2c25..db315a2 100644
+--- a/tests/test_aspectlib_test.py
++++ b/tests/test_aspectlib_test.py
+@@ -414,14 +414,14 @@ def test_story_empty_play_proxy_class():
+         (('stuff_1', 'mix', "'a', 'b'", ''), _Returns("(1, 2, 'a', 'b')")),
+         (('stuff_1', 'meth', "123", ''), _Raises(repr_ex(TypeError(
+             'meth() takes exactly 1 argument (2 given)' if PY2 else
+-            'meth() takes 1 positional argument but 2 were given'
++            'Stuff.meth() takes 1 positional argument but 2 were given'
+         )))),
+         ((None, 'test_pkg1.test_pkg2.test_mod.Stuff', "0, 1", ''), _Binds('stuff_2')),
+         (('stuff_2', 'mix', "'a', 'b'", ''), _Returns("(0, 1, 'a', 'b')")),
+         (('stuff_2', 'mix', "3, 4", ''), _Returns("(0, 1, 3, 4)")),
+         (('stuff_2', 'meth', "123", ''), _Raises(repr_ex(TypeError(
+             'meth() takes exactly 1 argument (2 given)' if PY2 else
+-            'meth() takes 1 positional argument but 2 were given'
++            'Stuff.meth() takes 1 positional argument but 2 were given'
+         ))))
+     ]))
+ 
+@@ -449,14 +449,14 @@ def test_story_half_play_proxy_class():
+         (('stuff_1', 'meth', '', ''), _Returns('None')),
+         (('stuff_1', 'meth', '123', ''), _Raises(repr_ex(TypeError(
+             'meth() takes exactly 1 argument (2 given)' if PY2 else
+-            'meth() takes 1 positional argument but 2 were given'
++            'Stuff.meth() takes 1 positional argument but 2 were given'
+         )))),
+         ((None, 'test_pkg1.test_pkg2.test_mod.Stuff', '0, 1', ''), _Binds("stuff_2")),
+         (('stuff_2', 'mix', "'a', 'b'", ''), _Returns("(0, 1, 'a', 'b')")),
+         (('stuff_2', 'mix',  '3, 4', ''), _Returns('(0, 1, 3, 4)')),
+         (('stuff_2', 'meth', '123', ''), _Raises(repr_ex(TypeError(
+             'meth() takes exactly 1 argument (2 given)' if PY2 else
+-            'meth() takes 1 positional argument but 2 were given'
++            'Stuff.meth() takes 1 positional argument but 2 were given'
+         ))))
+     ]))
+ 
meta-python/recipes-devtools/python/python3-aspectlib_1.5.2.bb +1 -0
index 0cbeca21c7..ba4baefaf9 100644
@@ -12,6 +12,7 @@ inherit ptest pypi setuptools3
 
 SRC_URI += "file://run-ptest \
             file://0001-Remove-tornado-6-test-constraint.-Ref-15.patch \
+            file://0001-fix-failing-ptests.patch \
            "
 
 do_install_ptest() {