Skip to content

Commit 2c7ffbd

Browse files
committed
[cppyy] Avoid cppdef in templates test test33_using_template_argument
The test hangs up occasionally in the CI like in the last nightlies on **macOS 26**: ```txt ../../../../../../src/bindings/pyroot/cppyy/cppyy/test/test_templates.py::TestTEMPLATES::test33_using_template_argument CMake Error at /Users/sftnight/ROOT-CI/src/cmake/modules/RootTestDriver.cmake:232 (message): error code: 129 `` Unfortunately I'm blind to what happens there. My best-effort solution for now would be to silmplify the test by avoiding declaring some code inside the test with `cppyy.cppdef` (aka. `gInterpreter.Declare`). Like this, many steps like C++ parsing or dictionary generation are not happening during the test, lowering the surface of where the hangup might happen. If we're lucky this fixes it, and if not we have at least narrowed down a bit where the crash might happen.
1 parent c8eeff1 commit 2c7ffbd

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

bindings/pyroot/cppyy/cppyy/test/templates.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,4 +522,17 @@ extern template class B<int>;
522522

523523
}
524524

525+
namespace UsingPtr {
526+
527+
struct Test {};
528+
using testptr = Test *;
529+
530+
template <typename T>
531+
bool testfun(T const &x)
532+
{
533+
return !(bool)x;
534+
}
535+
536+
}
537+
525538
#endif // !CPPYY_TEST_TEMPLATES_H

bindings/pyroot/cppyy/cppyy/test/test_templates.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,15 +1129,6 @@ def test33_using_template_argument(self):
11291129

11301130
import cppyy
11311131

1132-
cppyy.cppdef("""
1133-
namespace UsingPtr {
1134-
struct Test {};
1135-
using testptr = Test*;
1136-
1137-
template<typename T>
1138-
bool testfun(T const& x) { return !(bool)x; }
1139-
}""")
1140-
11411132
ns = cppyy.gbl.UsingPtr
11421133

11431134
assert ns.testfun["testptr"](cppyy.bind_object(cppyy.nullptr, ns.Test))

0 commit comments

Comments
 (0)