Bypass Python tests failing with -builtin
Reverse operators not supported in builtin types
This commit is contained in:
parent
bbad7f96ab
commit
9f1b051c16
5 changed files with 25 additions and 15 deletions
|
|
@ -49,6 +49,12 @@ std::basic_string<char,std::char_traits<char>,std::allocator<char> > test_value_
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SWIGPYTHON_BUILTIN
|
||||||
|
bool is_python_builtin() { return true; }
|
||||||
|
#else
|
||||||
|
bool is_python_builtin() { return false; }
|
||||||
|
#endif
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include "li_std_string.i"
|
%include "li_std_string.i"
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,12 @@ void test_throw() throw(std::wstring){
|
||||||
#pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
|
#pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SWIGPYTHON_BUILTIN
|
||||||
|
bool is_python_builtin() { return true; }
|
||||||
|
#else
|
||||||
|
bool is_python_builtin() { return false; }
|
||||||
|
#endif
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,6 @@ BUILTIN_BROKEN = \
|
||||||
autodoc.cpptest \
|
autodoc.cpptest \
|
||||||
default_constructor.cpptest \
|
default_constructor.cpptest \
|
||||||
import_nomodule.cpptest \
|
import_nomodule.cpptest \
|
||||||
li_std_string_extra.cpptest \
|
|
||||||
li_std_wstring.cpptest \
|
|
||||||
python_abstractbase.cpptest \
|
python_abstractbase.cpptest \
|
||||||
|
|
||||||
BUILTIN_NOT_BROKEN = $(filter-out $(BUILTIN_BROKEN),$(NOT_BROKEN_TEST_CASES))
|
BUILTIN_NOT_BROKEN = $(filter-out $(BUILTIN_BROKEN),$(NOT_BROKEN_TEST_CASES))
|
||||||
|
|
|
||||||
|
|
@ -56,13 +56,12 @@ if a + " world" != "hello world":
|
||||||
|
|
||||||
# This is expected to fail with -builtin option
|
# This is expected to fail with -builtin option
|
||||||
# Reverse operators not supported in builtin types
|
# Reverse operators not supported in builtin types
|
||||||
if "hello" + b != "hello world":
|
if not li_std_string_extra.is_python_builtin():
|
||||||
|
if "hello" + b != "hello world":
|
||||||
raise RuntimeError, "bad string mapping"
|
raise RuntimeError, "bad string mapping"
|
||||||
|
|
||||||
# This is expected to fail with -builtin option
|
c = "hello" + b
|
||||||
# Reverse operators not supported in builtin types
|
if c.find_last_of("l") != 9:
|
||||||
c = "hello" + b
|
|
||||||
if c.find_last_of("l") != 9:
|
|
||||||
raise RuntimeError, "bad string mapping"
|
raise RuntimeError, "bad string mapping"
|
||||||
|
|
||||||
s = "hello world"
|
s = "hello world"
|
||||||
|
|
|
||||||
|
|
@ -60,12 +60,13 @@ if a + " world" != "hello world":
|
||||||
raise RuntimeError("bad string mapping")
|
raise RuntimeError("bad string mapping")
|
||||||
|
|
||||||
# This is expected to fail if -builtin is used
|
# This is expected to fail if -builtin is used
|
||||||
if "hello" + b != "hello world":
|
# Reverse operators not supported in builtin types
|
||||||
|
if not li_std_wstring.is_python_builtin():
|
||||||
|
if "hello" + b != "hello world":
|
||||||
raise RuntimeError("bad string mapping")
|
raise RuntimeError("bad string mapping")
|
||||||
|
|
||||||
# This is expected to fail if -builtin is used
|
c = "hello" + b
|
||||||
c = "hello" + b
|
if c.find_last_of("l") != 9:
|
||||||
if c.find_last_of("l") != 9:
|
|
||||||
raise RuntimeError("bad string mapping")
|
raise RuntimeError("bad string mapping")
|
||||||
|
|
||||||
s = "hello world"
|
s = "hello world"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue