Bypass Python tests throwing base classes as exceptions for -builtin
Throwing builtin classes as exceptions is not supported
This commit is contained in:
parent
34eb4b15d3
commit
bbad7f96ab
9 changed files with 65 additions and 30 deletions
|
|
@ -89,14 +89,10 @@ include $(srcdir)/../common.mk
|
|||
BUILTIN_BROKEN = \
|
||||
autodoc.cpptest \
|
||||
default_constructor.cpptest \
|
||||
director_exception.cpptest \
|
||||
exception_order.cpptest \
|
||||
import_nomodule.cpptest \
|
||||
li_std_except_as_class.cpptest \
|
||||
li_std_string_extra.cpptest \
|
||||
li_std_wstring.cpptest \
|
||||
python_abstractbase.cpptest \
|
||||
threads_exception.cpptest
|
||||
|
||||
BUILTIN_NOT_BROKEN = $(filter-out $(BUILTIN_BROKEN),$(NOT_BROKEN_TEST_CASES))
|
||||
|
||||
|
|
|
|||
|
|
@ -68,14 +68,13 @@ if not ok:
|
|||
|
||||
# This is expected to fail with -builtin option
|
||||
# Throwing builtin classes as exceptions not supported
|
||||
try:
|
||||
raise Exception2()
|
||||
except Exception2:
|
||||
pass
|
||||
if not is_python_builtin():
|
||||
try:
|
||||
raise Exception2()
|
||||
except Exception2:
|
||||
pass
|
||||
|
||||
# This is expected to fail with -builtin option
|
||||
# Throwing builtin classes as exceptions not supported
|
||||
try:
|
||||
raise Exception1()
|
||||
except Exception1:
|
||||
pass
|
||||
try:
|
||||
raise Exception1()
|
||||
except Exception1:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ from exception_order import *
|
|||
|
||||
# This test is expected to fail with -builtin option.
|
||||
# Throwing builtin classes as exceptions not supported
|
||||
if is_python_builtin():
|
||||
exit(0)
|
||||
|
||||
a = A()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,19 @@
|
|||
from li_std_except_as_class import *
|
||||
|
||||
# std::domain_error hierarchy
|
||||
try: test_domain_error()
|
||||
except domain_error: pass
|
||||
try: test_domain_error()
|
||||
except logic_error: pass
|
||||
try: test_domain_error()
|
||||
except exception: pass
|
||||
# This test is expected to fail with -builtin option.
|
||||
# Throwing builtin classes as exceptions not supported
|
||||
if is_python_builtin():
|
||||
try: test_domain_error()
|
||||
except RuntimeError: pass
|
||||
try: test_domain_error()
|
||||
except RuntimeError: pass
|
||||
try: test_domain_error()
|
||||
except RuntimeError: pass
|
||||
else:
|
||||
# std::domain_error hierarchy
|
||||
try: test_domain_error()
|
||||
except domain_error: pass
|
||||
try: test_domain_error()
|
||||
except logic_error: pass
|
||||
try: test_domain_error()
|
||||
except exception: pass
|
||||
|
|
|
|||
|
|
@ -20,15 +20,16 @@ except RuntimeError,e:
|
|||
|
||||
# This is expected fail with -builtin option
|
||||
# Throwing builtin classes as exceptions not supported
|
||||
try:
|
||||
t.hosed()
|
||||
except threads_exception.Exc,e:
|
||||
code = e.code
|
||||
if code != 42:
|
||||
raise RuntimeError, "bad... code: %d" % code
|
||||
msg = e.msg
|
||||
if msg != "Hosed":
|
||||
raise RuntimeError, "bad... msg: '%s' len: %d" % (msg, len(msg))
|
||||
if not threads_exception.is_python_builtin():
|
||||
try:
|
||||
t.hosed()
|
||||
except threads_exception.Exc,e:
|
||||
code = e.code
|
||||
if code != 42:
|
||||
raise RuntimeError, "bad... code: %d" % code
|
||||
msg = e.msg
|
||||
if msg != "Hosed":
|
||||
raise RuntimeError, "bad... msg: '%s' len: %d" % (msg, len(msg))
|
||||
|
||||
for i in range(1,4):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue