From da07af7fe20b7ec80f88bd44d9331e7ed82083af Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 6 Apr 2022 22:33:17 +0100 Subject: [PATCH] doxygen_autodoc_docstring test fix for Python builtin --- Examples/test-suite/doxygen_autodoc_docstring.i | 9 +++++++++ .../test-suite/python/doxygen_autodoc_docstring_runme.py | 3 +-- Examples/test-suite/python_builtin.i | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Examples/test-suite/doxygen_autodoc_docstring.i b/Examples/test-suite/doxygen_autodoc_docstring.i index 7dcaa56f5..e590d7f94 100644 --- a/Examples/test-suite/doxygen_autodoc_docstring.i +++ b/Examples/test-suite/doxygen_autodoc_docstring.i @@ -64,3 +64,12 @@ class ClassWithDoxygenComment2 {}; */ void functionWithDoxygenComment2(int number) {} %} + +%inline %{ +#ifdef SWIGPYTHON_BUILTIN +bool is_python_builtin() { return true; } +#else +bool is_python_builtin() { return false; } +#endif +%} + diff --git a/Examples/test-suite/python/doxygen_autodoc_docstring_runme.py b/Examples/test-suite/python/doxygen_autodoc_docstring_runme.py index bd6afe731..9780516b9 100644 --- a/Examples/test-suite/python/doxygen_autodoc_docstring_runme.py +++ b/Examples/test-suite/python/doxygen_autodoc_docstring_runme.py @@ -5,10 +5,9 @@ import os import sys import comment_verifier -exit(0) # temporarily skip runtime test until builtin is fixed # documentation from autogenerated 'feature:autodoc' comment_verifier.check(inspect.getdoc(ClassWithoutDoxygenComment), - "Proxy of C++ ClassWithoutDoxygenComment class.") + "::ClassWithoutDoxygenComment" if is_python_builtin() else "Proxy of C++ ClassWithoutDoxygenComment class.") comment_verifier.check(inspect.getdoc(functionWithoutDoxygenComment), "functionWithoutDoxygenComment(int number)") diff --git a/Examples/test-suite/python_builtin.i b/Examples/test-suite/python_builtin.i index 994c625e8..754526dad 100644 --- a/Examples/test-suite/python_builtin.i +++ b/Examples/test-suite/python_builtin.i @@ -244,4 +244,3 @@ public: } }; %} -