Bypass Python tests not supported by -builtin

The base class is needed for the builtin class hierarchy, like many
other languages
This commit is contained in:
William S Fulton 2014-10-04 18:40:19 +01:00
commit ab79441151
3 changed files with 13 additions and 2 deletions

View file

@ -8,7 +8,7 @@
%import "import_nomodule.h"
#if !defined(SWIGJAVA) && !defined(SWIGRUBY) && !defined(SWIGCSHARP) && !defined(SWIGD)
#if !defined(SWIGJAVA) && !defined(SWIGRUBY) && !defined(SWIGCSHARP) && !defined(SWIGD) && !defined(SWIGPYTHON_BUILTIN)
/**
* The proxy class does not have Bar derived from Foo, yet an instance of Bar
@ -40,3 +40,10 @@ class Bar : public Foo { };
#endif
%inline %{
#ifdef SWIGPYTHON_BUILTIN
bool is_python_builtin() { return true; }
#else
bool is_python_builtin() { return false; }
#endif
%}

View file

@ -87,7 +87,6 @@ C_TEST_CASES += \
include $(srcdir)/../common.mk
BUILTIN_BROKEN = \
import_nomodule.cpptest \
python_abstractbase.cpptest \
BUILTIN_NOT_BROKEN = $(filter-out $(BUILTIN_BROKEN),$(NOT_BROKEN_TEST_CASES))

View file

@ -1,5 +1,10 @@
from import_nomodule import *
# This test is expected to fail with -builtin option.
# The base class is needed for the builtin class hierarchy
if is_python_builtin():
exit(0)
f = create_Foo()
test1(f,42)
delete_Foo(f)