dotest.py: Remove useless AttributeError catches

Summary:
Test decorators were ignoring AttributeError exceptions. These were introduced three years ago,
and copied to all decorators. They seem to serve no purpose and removing them produces no errors.
Given that they have prevented us from noticing the problem in r249819, I am removing them.

Reviewers: zturner, tfiala

Subscribers: iancottrell, lldb-commits

Differential Revision: http://reviews.llvm.org/D13583

llvm-svn: 250038
This commit is contained in:
Pavel Labath
2015-10-12 13:42:16 +00:00
parent 753726d6a9
commit f882f6fcd5

View File

@@ -475,11 +475,8 @@ def python_api_test(func):
raise Exception("@python_api_test can only be used to decorate a test method")
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
if lldb.dont_do_python_api_test:
self.skipTest("python api tests")
except AttributeError:
pass
if lldb.dont_do_python_api_test:
self.skipTest("python api tests")
return func(self, *args, **kwargs)
# Mark this function as such to separate them from lldb command line tests.
@@ -492,11 +489,8 @@ def lldbmi_test(func):
raise Exception("@lldbmi_test can only be used to decorate a test method")
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
if lldb.dont_do_lldbmi_test:
self.skipTest("lldb-mi tests")
except AttributeError:
pass
if lldb.dont_do_lldbmi_test:
self.skipTest("lldb-mi tests")
return func(self, *args, **kwargs)
# Mark this function as such to separate them from lldb command line tests.
@@ -509,11 +503,8 @@ def benchmarks_test(func):
raise Exception("@benchmarks_test can only be used to decorate a test method")
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
if not lldb.just_do_benchmarks_test:
self.skipTest("benchmarks tests")
except AttributeError:
pass
if not lldb.just_do_benchmarks_test:
self.skipTest("benchmarks tests")
return func(self, *args, **kwargs)
# Mark this function as such to separate them from the regular tests.
@@ -539,11 +530,8 @@ def dsym_test(func):
raise Exception("@dsym_test can only be used to decorate a test method")
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
if lldb.dont_do_dsym_test:
self.skipTest("dsym tests")
except AttributeError:
pass
if lldb.dont_do_dsym_test:
self.skipTest("dsym tests")
return func(self, *args, **kwargs)
# Mark this function as such to separate them from the regular tests.
@@ -556,11 +544,8 @@ def dwarf_test(func):
raise Exception("@dwarf_test can only be used to decorate a test method")
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
if lldb.dont_do_dwarf_test:
self.skipTest("dwarf tests")
except AttributeError:
pass
if lldb.dont_do_dwarf_test:
self.skipTest("dwarf tests")
return func(self, *args, **kwargs)
# Mark this function as such to separate them from the regular tests.
@@ -573,11 +558,8 @@ def dwo_test(func):
raise Exception("@dwo_test can only be used to decorate a test method")
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
if lldb.dont_do_dwo_test:
self.skipTest("dwo tests")
except AttributeError:
pass
if lldb.dont_do_dwo_test:
self.skipTest("dwo tests")
return func(self, *args, **kwargs)
# Mark this function as such to separate them from the regular tests.
@@ -590,11 +572,8 @@ def debugserver_test(func):
raise Exception("@debugserver_test can only be used to decorate a test method")
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
if lldb.dont_do_debugserver_test:
self.skipTest("debugserver tests")
except AttributeError:
pass
if lldb.dont_do_debugserver_test:
self.skipTest("debugserver tests")
return func(self, *args, **kwargs)
# Mark this function as such to separate them from the regular tests.
@@ -607,11 +586,8 @@ def llgs_test(func):
raise Exception("@llgs_test can only be used to decorate a test method")
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
if lldb.dont_do_llgs_test:
self.skipTest("llgs tests")
except AttributeError:
pass
if lldb.dont_do_llgs_test:
self.skipTest("llgs tests")
return func(self, *args, **kwargs)
# Mark this function as such to separate them from the regular tests.
@@ -624,11 +600,8 @@ def not_remote_testsuite_ready(func):
raise Exception("@not_remote_testsuite_ready can only be used to decorate a test method")
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
if lldb.lldbtest_remote_sandbox or lldb.remote_platform:
self.skipTest("not ready for remote testsuite")
except AttributeError:
pass
if lldb.lldbtest_remote_sandbox or lldb.remote_platform:
self.skipTest("not ready for remote testsuite")
return func(self, *args, **kwargs)
# Mark this function as such to separate them from the regular tests.