diff options
author | Zachary Turner <zturner@google.com> | 2016-02-09 00:36:22 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-02-09 00:36:22 +0000 |
commit | 779df76c56d68f15905e5d9c3f180a6b3d339479 (patch) | |
tree | 9631f033501cf9a39522c07ab48b8756d4e0d3b8 /lldb/packages/Python/lldbsuite/test | |
parent | aa42f292210faddaeecfafd65a1f9a1a3305d74c (diff) | |
download | bcm5719-llvm-779df76c56d68f15905e5d9c3f180a6b3d339479.tar.gz bcm5719-llvm-779df76c56d68f15905e5d9c3f180a6b3d339479.zip |
Remove the skipUnlessArch decorator.
Convert everything over to using skipIf.
llvm-svn: 260176
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
3 files changed, 8 insertions, 35 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index 0e5fb6e1868..a4ef73b6073 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -291,14 +291,6 @@ def not_remote_testsuite_ready(func): return "Not ready for remote testsuite" if lldb.remote_platform else None return skipTestIfFn(is_remote)(func) -def _match_architectures(archs, actual_arch): - retype = type(re.compile('hello, world')) - list_passes = isinstance(archs, list) and actual_arch in archs - basestring_passes = isinstance(archs, six.string_types) and actual_arch == archs - regex_passes = isinstance(archs, retype) and re.match(archs, actual_arch) - - return (list_passes or basestring_passes or regex_passes) - def expectedFailureDwarf(bugnumber=None): return expectedFailureAll(bugnumber=bugnumber, debug_info="dwarf") @@ -559,25 +551,6 @@ def skipUnlessHostPlatform(oslist): """Decorate the item to skip tests unless running on one of the listed host platforms.""" return skipIf(hostoslist=no_match(oslist)) -def skipUnlessArch(archs): - """Decorate the item to skip tests unless running on one of the listed architectures.""" - # This decorator cannot be ported to `skipIf` yet because it is uused with regular - # expressions, which the common matcher does not yet support. - def myImpl(func): - if isinstance(func, type) and issubclass(func, unittest2.TestCase): - raise Exception("@skipUnlessArch can only be used to decorate a test method") - - @wraps(func) - def wrapper(*args, **kwargs): - self = args[0] - if not _match_architectures(archs, self.getArchitecture()): - self.skipTest("skipping for architecture %s" % (self.getArchitecture())) - else: - func(*args, **kwargs) - return wrapper - - return myImpl - def skipIfPlatform(oslist): """Decorate the item to skip tests if running on one of the listed platforms.""" # This decorator cannot be ported to `skipIf` yet because it is used on entire diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py b/lldb/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py index 5abfec553dd..21de3ab7cc3 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py @@ -26,7 +26,7 @@ class RegisterCommandsTestCase(TestBase): TestBase.tearDown(self) @skipIfiOSSimulator - @skipUnlessArch(['amd64', 'arm', 'i386', 'x86_64']) + @skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64'])) def test_register_commands(self): """Test commands related to registers, in particular vector registers.""" self.build() @@ -49,7 +49,7 @@ class RegisterCommandsTestCase(TestBase): @skipIfiOSSimulator @skipIfTargetAndroid(archs=["i386"]) # Writing of mxcsr register fails, presumably due to a kernel/hardware problem - @skipUnlessArch(['amd64', 'arm', 'i386', 'x86_64']) + @skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64'])) def test_fp_register_write(self): """Test commands that write to registers, in particular floating-point registers.""" self.build() @@ -58,14 +58,14 @@ class RegisterCommandsTestCase(TestBase): @skipIfiOSSimulator @expectedFailureAndroid(archs=["i386"]) # "register read fstat" always return 0xffff @skipIfFreeBSD #llvm.org/pr25057 - @skipUnlessArch(['amd64', 'i386', 'x86_64']) + @skipIf(archs=no_match(['amd64', 'i386', 'x86_64'])) def test_fp_special_purpose_register_read(self): """Test commands that read fpu special purpose registers.""" self.build() self.fp_special_purpose_register_read() @skipIfiOSSimulator - @skipUnlessArch(['amd64', 'arm', 'i386', 'x86_64']) + @skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64'])) def test_register_expressions(self): """Test expression evaluation with commands related to registers.""" self.build() @@ -86,21 +86,21 @@ class RegisterCommandsTestCase(TestBase): self.expect("expr -- ($rax & 0xffffffff) == $eax", substrs = ['true']) @skipIfiOSSimulator - @skipUnlessArch(['amd64', 'x86_64']) + @skipIf(archs=no_match(['amd64', 'x86_64'])) def test_convenience_registers(self): """Test convenience registers.""" self.build() self.convenience_registers() @skipIfiOSSimulator - @skipUnlessArch(['amd64', 'x86_64']) + @skipIf(archs=no_match(['amd64', 'x86_64'])) def test_convenience_registers_with_process_attach(self): """Test convenience registers after a 'process attach'.""" self.build() self.convenience_registers_with_process_attach(test_16bit_regs=False) @skipIfiOSSimulator - @skipUnlessArch(['amd64', 'x86_64']) + @skipIf(archs=no_match(['amd64', 'x86_64'])) def test_convenience_registers_16bit_with_process_attach(self): """Test convenience registers after a 'process attach'.""" self.build() diff --git a/lldb/packages/Python/lldbsuite/test/settings/TestSettings.py b/lldb/packages/Python/lldbsuite/test/settings/TestSettings.py index d633e06f0e7..c7aa8d3f108 100644 --- a/lldb/packages/Python/lldbsuite/test/settings/TestSettings.py +++ b/lldb/packages/Python/lldbsuite/test/settings/TestSettings.py @@ -176,7 +176,7 @@ class SettingsCommandTestCase(TestBase): self.expect("settings show auto-confirm", SETTING_MSG("auto-confirm"), startstr = "auto-confirm (boolean) = false") - @skipUnlessArch(['x86_64', 'i386', 'i686']) + @skipIf(archs=no_match(['x86_64', 'i386', 'i686'])) def test_disassembler_settings(self): """Test that user options for the disassembler take effect.""" self.build() |