From afcd61388ae5d56b3e3821f39976e2b214d2f27f Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 2 Oct 2014 20:23:08 +0100 Subject: [PATCH] Bypass Python tests not supported by -builtin The old static syntax (e.g., dc.new_A() rather than dc.A()) is not supported with -builtin --- Examples/test-suite/default_constructor.i | 8 +++++++- Examples/test-suite/python/Makefile.in | 1 - Examples/test-suite/python/default_constructor_runme.py | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Examples/test-suite/default_constructor.i b/Examples/test-suite/default_constructor.i index 091adff20..f7fc8cfa6 100644 --- a/Examples/test-suite/default_constructor.i +++ b/Examples/test-suite/default_constructor.i @@ -168,5 +168,11 @@ public: } }; - +%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/Makefile.in b/Examples/test-suite/python/Makefile.in index 33fd34263..87dac2565 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -88,7 +88,6 @@ include $(srcdir)/../common.mk BUILTIN_BROKEN = \ autodoc.cpptest \ - default_constructor.cpptest \ import_nomodule.cpptest \ python_abstractbase.cpptest \ diff --git a/Examples/test-suite/python/default_constructor_runme.py b/Examples/test-suite/python/default_constructor_runme.py index 59b130559..e6532031b 100644 --- a/Examples/test-suite/python/default_constructor_runme.py +++ b/Examples/test-suite/python/default_constructor_runme.py @@ -1,8 +1,10 @@ +import _default_constructor + # This test is expected to fail with -builtin option. # It uses the old static syntax (e.g., dc.new_A() rather than dc.A()), # which is not provided with the -builtin option. - -import _default_constructor +if _default_constructor.is_python_builtin(): + exit(0) dc = _default_constructor