commit:     221b27ca6002eaccdd6a9bd30fab9eee8894c7e1
Author:     Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 26 20:05:26 2024 +0000
Commit:     Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
CommitDate: Mon Aug 26 20:06:31 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=221b27ca

dev-python/pygccxml: Fix tests

Closes: https://bugs.gentoo.org/936005
Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org>

 .../pygccxml/files/pygccxml-2.5.0-fix-tests.patch  | 107 +++++++++++++++++++++
 dev-python/pygccxml/pygccxml-2.5.0.ebuild          |   1 +
 2 files changed, 108 insertions(+)

diff --git a/dev-python/pygccxml/files/pygccxml-2.5.0-fix-tests.patch 
b/dev-python/pygccxml/files/pygccxml-2.5.0-fix-tests.patch
new file mode 100644
index 000000000000..5a65fd826fff
--- /dev/null
+++ b/dev-python/pygccxml/files/pygccxml-2.5.0-fix-tests.patch
@@ -0,0 +1,107 @@
+diff --git a/unittests/test_cpp_standards.py b/unittests/test_cpp_standards.py
+index eb28418..7c76c73 100644
+--- a/unittests/test_cpp_standards.py
++++ b/unittests/test_cpp_standards.py
+@@ -23,7 +23,8 @@ class Test(parser_test_case.parser_test_case_t):
+         if "gccxml" in self.config.xml_generator:
+             return True
+ 
+-        parser.parse(["cpp_standards.hpp"], self.config)
++        parser.parse(["cpp_standards.hpp"], self.config,
++        parser.COMPILATION_MODE.ALL_AT_ONCE)
+ 
+         if platform.system() != 'Windows':
+             self.config.cflags = "-std=c++98"
+@@ -33,7 +34,8 @@ class Test(parser_test_case.parser_test_case_t):
+             parser.parse(["cpp_standards.hpp"], self.config)
+ 
+         self.config.cflags = "-std=c++11"
+-        parser.parse(["cpp_standards.hpp"], self.config)
++        parser.parse(["cpp_standards.hpp"], self.config,
++        parser.COMPILATION_MODE.ALL_AT_ONCE)
+ 
+         # This is broken with llvm 3.6.2 (the one from homebrew)
+         # It should work with never llvms but I keep the test disabled
+diff --git a/unittests/test_non_copyable_recursive.py 
b/unittests/test_non_copyable_recursive.py
+index cd78a9a..e18d58f 100644
+--- a/unittests/test_non_copyable_recursive.py
++++ b/unittests/test_non_copyable_recursive.py
+@@ -27,7 +27,7 @@ class Test(parser_test_case.parser_test_case_t):
+         RuntimeError: maximum recursion depth exceeded while
+         calling a Python object
+         """
+-        decls = parser.parse([self.header], self.config)
++        decls = parser.parse([self.header], self.config, 
parser.COMPILATION_MODE.ALL_AT_ONCE)
+         global_ns = declarations.get_global_namespace(decls)
+ 
+         # Description of the problem (before the fix):
+@@ -52,7 +52,7 @@ class Test(parser_test_case.parser_test_case_t):
+         RuntimeError: maximum recursion depth exceeded while
+         calling a Python object
+         """
+-        decls = parser.parse([self.header], self.config)
++        decls = parser.parse([self.header], self.config, 
parser.COMPILATION_MODE.ALL_AT_ONCE)
+         global_ns = declarations.get_global_namespace(decls)
+ 
+         # Real life example of the bug. This leads to a similar error,
+diff --git a/unittests/test_null_comparison.py 
b/unittests/test_null_comparison.py
+index 51caf4a..787ae79 100644
+--- a/unittests/test_null_comparison.py
++++ b/unittests/test_null_comparison.py
+@@ -22,7 +22,7 @@ class Test(parser_test_case.parser_test_case_t):
+         Test for None comparisons with default arguments
+         """
+ 
+-        decls = parser.parse([self.header], self.config)
++        decls = parser.parse([self.header], self.config, 
parser.COMPILATION_MODE.ALL_AT_ONCE)
+         global_ns = declarations.get_global_namespace(decls)
+ 
+         ns = global_ns.namespace("ns")
+diff --git a/unittests/test_overrides.py b/unittests/test_overrides.py
+index 9204efc..5ac1b25 100644
+--- a/unittests/test_overrides.py
++++ b/unittests/test_overrides.py
+@@ -23,7 +23,7 @@ class Test(parser_test_case.parser_test_case_t):
+     def setUp(self):
+ 
+         if not self.global_ns:
+-            decls = parser.parse([self.header], self.config)
++            decls = parser.parse([self.header], self.config, 
parser.COMPILATION_MODE.ALL_AT_ONCE)
+             Test.global_ns = declarations.get_global_namespace(decls)
+             Test.xml_generator_from_xml_file = \
+                 self.config.xml_generator_from_xml_file
+diff --git a/unittests/test_pattern_parser.py 
b/unittests/test_pattern_parser.py
+index 00a6805..4882c26 100644
+--- a/unittests/test_pattern_parser.py
++++ b/unittests/test_pattern_parser.py
+@@ -27,7 +27,7 @@ class Test(parser_test_case.parser_test_case_t):
+         if self.config.xml_generator == "gccxml":
+             return
+ 
+-        decls = parser.parse([self.header], self.config)
++        decls = parser.parse([self.header], self.config, 
parser.COMPILATION_MODE.ALL_AT_ONCE)
+ 
+         for decl in declarations.make_flatten(decls):
+             if "myClass" in decl.name:
+@@ -44,7 +44,7 @@ class Test(parser_test_case.parser_test_case_t):
+         if self.config.xml_generator == "gccxml":
+             return
+ 
+-        decls = parser.parse([self.header], self.config)
++        decls = parser.parse([self.header], self.config, 
parser.COMPILATION_MODE.ALL_AT_ONCE)
+         global_ns = declarations.get_global_namespace(decls)
+         criteria = declarations.declaration_matcher(name="myClass")
+         _ = declarations.matcher.find(criteria, global_ns)
+diff --git a/unittests/test_smart_pointer.py b/unittests/test_smart_pointer.py
+index e9183b7..4a85860 100644
+--- a/unittests/test_smart_pointer.py
++++ b/unittests/test_smart_pointer.py
+@@ -22,7 +22,7 @@ class Test(parser_test_case.parser_test_case_t):
+     def setUp(self):
+         if self.config.xml_generator == "gccxml":
+             return
+-        decls = parser.parse([self.header], self.config)
++        decls = parser.parse([self.header], self.config, 
parser.COMPILATION_MODE.ALL_AT_ONCE)
+         self.global_ns = declarations.get_global_namespace(decls)
+ 
+     def test_is_smart_pointer(self):

diff --git a/dev-python/pygccxml/pygccxml-2.5.0.ebuild 
b/dev-python/pygccxml/pygccxml-2.5.0.ebuild
index ba61c6612e8e..f9950b4f3f47 100644
--- a/dev-python/pygccxml/pygccxml-2.5.0.ebuild
+++ b/dev-python/pygccxml/pygccxml-2.5.0.ebuild
@@ -40,6 +40,7 @@ EPYTEST_DESELECT=(
 
 python_prepare_all() {
        local PATCHES=(
+               "${FILESDIR}/${PN}-2.5.0-fix-tests.patch"
                "${FILESDIR}/${PN}-2.4.0-doc.patch"
                # https://github.com/CastXML/pygccxml/pull/179
                "${FILESDIR}/${P}-which.patch"

Reply via email to