[lldb] Introduce the require decorator (#212753)
Currently, it is unclear if a test that is skipped is either:
- Unsupported because it will never run (macosx tests should not run on
Windows).
- Skipped because it's supposed to work but does not yet.
`@expectedFailure` is not always an option because a test might be
timing out and waiting 600s for it to fail is not acceptable.
This patch introduces 2 new decorators to differentiate those tests:
- `@requireX` meaning the tests require X to run (e.g `@requireDarwin`).
- `@requireNotX` meaning the tests requires anything but `X` to run (e.g
`@requireNotDarwin`).
In the tests results summary, this introduces a new category: `skipped`
tests:
- `@requireX` -> `UNSUPPORTED`
- `@skipIfX` -> `SKIPPED`
Here is how they can and cannot be stacked:
This will never run:
```py3
@requireDarwin
@requireWindows
def test():
...
```
This will not run on Linux, because `@requireWindows` is not satisfied.
```py3
@requireNotDarwin
@requireWindows
def test():
...
```
For "require Darwin or Windows", you need:
```py3
@requirePlatform(["darwin", "windows"])
def test():
...
```
For "require Darwin on ARM64 or Windows on ARM64", you need:
```py3
@requireARM64
@requirePlatform(["darwin", "windows"])
def test():
...
```
This patch also converts the tests in
`lldb/tests/API/{macosx,linux,windows}` to use these decorators. Patches
to convert the rest of the tests will follow.
This commit is contained in:
parent
bd427e721e
commit
67a20745d6
88 changed files with 322 additions and 125 deletions
|
|
@ -137,6 +137,35 @@ the test should be run or not.
|
|||
@skipTestIfFn(checking_function_name)
|
||||
```
|
||||
|
||||
### Skipped versus unsupported
|
||||
|
||||
A test that doesn't run does so for one of two very different reasons, and the
|
||||
decorator you pick says which:
|
||||
|
||||
* The test **can never** run in this configuration. A test for Mach-O debug
|
||||
maps has nothing to say on Linux; a test that calls `fork()` has nothing to
|
||||
say on Windows. Use the `require*` family. These are reported as
|
||||
**UNSUPPORTED**.
|
||||
|
||||
* The test **ought to** run in this configuration but doesn't work yet. Use the
|
||||
`skipIf*` / `skipUnless*` family. These are reported as **SKIPPED**, which
|
||||
keeps them visible as work still to be done.
|
||||
|
||||
```python
|
||||
@requireDarwin # inherently Darwin-only: reported UNSUPPORTED elsewhere
|
||||
@skipIfWindows # ought to work on Windows, currently broken: reported SKIPPED
|
||||
```
|
||||
|
||||
The `require*` decorators mirror the `skip*` ones one-for-one:
|
||||
`requireDarwin` / `requireNotDarwin`, `requireLinux` / `requireNotLinux`,
|
||||
`requireWindows` / `requireNotWindows`, plus `requirePOSIX`, `requireSignals`,
|
||||
`requireNotWasm`, `requireDarwinHost`, and the general
|
||||
`requirePlatform(oslist)` / `requireNotPlatform(oslist)`.
|
||||
|
||||
Reach for `require*` when the test is tied to a platform-specific file format,
|
||||
API, or OS feature. If the test is merely untested or broken somewhere, keep
|
||||
`skipIf*` so nobody mistakes a bug for a design decision.
|
||||
|
||||
In addition to providing a lot more flexibility when it comes to writing the
|
||||
test, the API test also allow for much more complex scenarios when it comes to
|
||||
building inferiors. Every test has its own `Makefile`, most of them only a
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ from lldbsuite.support import temp_file
|
|||
from lldbsuite.test import lldbplatform
|
||||
from lldbsuite.test import lldbplatformutil
|
||||
from lldbsuite.test.cpu_feature import CPUFeature
|
||||
from lldbsuite.test.skip_reason import UnsupportedReason
|
||||
|
||||
|
||||
class DecorateMode:
|
||||
|
|
@ -1123,6 +1124,126 @@ def skipUnlessPlatform(oslist):
|
|||
)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Platform *requirement* decorators.
|
||||
#
|
||||
# These express "this test can only ever run here", as opposed to the skipIf /
|
||||
# skipUnless family which means "this test ought to run here but is broken".
|
||||
# Tests turned off by a `require*` decorator are reported as UNSUPPORTED; tests
|
||||
# turned off by a `skip*` decorator are reported as SKIPPED. See
|
||||
# `lldbsuite.test.skip_reason` for how the distinction is carried.
|
||||
#
|
||||
# Reach for these when the test is inherently tied to a platform: it debugs a
|
||||
# platform-specific file format, drives a platform-specific API, or exercises
|
||||
# an OS feature that simply doesn't exist elsewhere. If the test is merely
|
||||
# untested or broken somewhere, keep using skipIf / skipUnless so it stays
|
||||
# visible as work to be done.
|
||||
##############################################################################
|
||||
|
||||
|
||||
def requirePlatform(oslist):
|
||||
"""Mark the item as runnable only on the listed target platforms.
|
||||
|
||||
Unlike `skipUnlessPlatform`, other platforms are reported as UNSUPPORTED
|
||||
rather than SKIPPED.
|
||||
"""
|
||||
return unittest.skipUnless(
|
||||
lldbplatformutil.getPlatform() in oslist,
|
||||
UnsupportedReason("requires one of %s" % (", ".join(oslist))),
|
||||
)
|
||||
|
||||
|
||||
def requireNotPlatform(oslist):
|
||||
"""Mark the item as inherently inapplicable to the listed target platforms.
|
||||
|
||||
Unlike `skipIfPlatform`, the listed platforms are reported as UNSUPPORTED
|
||||
rather than SKIPPED.
|
||||
"""
|
||||
return unittest.skipIf(
|
||||
lldbplatformutil.getPlatform() in oslist,
|
||||
UnsupportedReason("unsupported on %s" % (", ".join(oslist))),
|
||||
)
|
||||
|
||||
|
||||
def requireDarwin(func):
|
||||
"""Mark the item as inherently Darwin-only (Mach-O, debug maps, Darwin
|
||||
kernel/runtime APIs, ...). Non-Darwin targets report UNSUPPORTED."""
|
||||
return requirePlatform(lldbplatform.translate(lldbplatform.darwin_all))(func)
|
||||
|
||||
|
||||
def requireNotDarwin(func):
|
||||
"""Mark the item as inherently inapplicable to Darwin targets."""
|
||||
return requireNotPlatform(lldbplatform.translate(lldbplatform.darwin_all))(func)
|
||||
|
||||
|
||||
def requireLinux(func):
|
||||
"""Mark the item as inherently Linux-only (procfs, Linux-specific syscalls,
|
||||
...). Other targets report UNSUPPORTED."""
|
||||
return requirePlatform(["linux"])(func)
|
||||
|
||||
|
||||
def requireNotLinux(func):
|
||||
"""Mark the item as inherently inapplicable to Linux targets."""
|
||||
return requireNotPlatform(["linux"])(func)
|
||||
|
||||
|
||||
def requireWindows(func):
|
||||
"""Mark the item as inherently Windows-only (PE/COFF, Win32 APIs, ...).
|
||||
Other targets report UNSUPPORTED."""
|
||||
return requirePlatform(["windows"])(func)
|
||||
|
||||
|
||||
def requireNotWindows(func):
|
||||
"""Mark the item as inherently inapplicable to Windows targets.
|
||||
|
||||
Use this for tests built on POSIX-only concepts: fork/exec semantics,
|
||||
POSIX signals, ptrace, ELF/Mach-O specifics, shell pipelines, and so on.
|
||||
"""
|
||||
return requireNotPlatform(["windows"])(func)
|
||||
|
||||
|
||||
def requirePOSIX(func):
|
||||
"""Mark the item as requiring a POSIX target.
|
||||
|
||||
A shorthand for `requireNotWindows` that reads better on tests whose
|
||||
dependency is POSIX semantics generally rather than anything about
|
||||
Windows specifically.
|
||||
"""
|
||||
return requireNotPlatform(["windows"])(func)
|
||||
|
||||
|
||||
def requireSignals(func):
|
||||
"""Mark the item as requiring POSIX signal support on the target."""
|
||||
return requireNotPlatform(["windows", "wasip1", "wasi"])(func)
|
||||
|
||||
|
||||
def requireNotWasm(func):
|
||||
"""Mark the item as inherently inapplicable to WebAssembly targets.
|
||||
|
||||
WebAssembly has no processes, no signals, no shared libraries and no
|
||||
ptrace-style debugging, so a large amount of the test suite can never
|
||||
apply to it.
|
||||
"""
|
||||
return requireNotPlatform(["wasip1", "wasi"])(func)
|
||||
|
||||
|
||||
def requireHostPlatform(oslist):
|
||||
"""Mark the item as runnable only on the listed *host* platforms."""
|
||||
return unittest.skipUnless(
|
||||
lldbplatformutil.getHostPlatform() in oslist,
|
||||
UnsupportedReason("requires one of %s as host" % (", ".join(oslist))),
|
||||
)
|
||||
|
||||
|
||||
def requireDarwinHost(func):
|
||||
"""Mark the item as requiring a Darwin host, regardless of target.
|
||||
|
||||
Use for tests that drive host-side Darwin facilities: `xcrun`, the
|
||||
simulator runtimes, dsymutil, the LLDB.framework layout, and so on.
|
||||
"""
|
||||
return requireHostPlatform(lldbplatform.translate(lldbplatform.darwin_all))(func)
|
||||
|
||||
|
||||
def skipIfTargetDoesNotSupportThreads():
|
||||
"""Skip tests that require thread support (e.g. pthreads)."""
|
||||
platform = lldbplatformutil.getPlatform()
|
||||
|
|
|
|||
|
|
@ -1255,6 +1255,12 @@ def run_suite():
|
|||
|
||||
configuration.failed = not result.wasSuccessful()
|
||||
|
||||
if getattr(result, "skipped", None):
|
||||
sys.stderr.write(
|
||||
"Skip breakdown (unsupported=%d, skipped=%d)\n"
|
||||
% (result.countUnsupported(), result.countSkipped())
|
||||
)
|
||||
|
||||
if configuration.sdir_has_content and configuration.verbose:
|
||||
sys.stderr.write(
|
||||
"Session logs for test failures/errors/unexpected successes"
|
||||
|
|
|
|||
17
lldb/packages/Python/lldbsuite/test/skip_reason.py
Normal file
17
lldb/packages/Python/lldbsuite/test/skip_reason.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
"""
|
||||
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
See https://llvm.org/LICENSE.txt for license information.
|
||||
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
Distinguishes the two reasons a test can end up not running.
|
||||
"""
|
||||
|
||||
|
||||
class UnsupportedReason(str):
|
||||
"""A skip reason meaning "this test can never run here", not "this test is
|
||||
broken here". Reported as UNSUPPORTED rather than SKIPPED."""
|
||||
|
||||
|
||||
def is_unsupported(reason):
|
||||
"""Return True if *reason* marks a test as unsupported rather than skipped."""
|
||||
return isinstance(reason, UnsupportedReason)
|
||||
|
|
@ -16,6 +16,7 @@ import unittest
|
|||
|
||||
# LLDB Modules
|
||||
from . import configuration
|
||||
from .skip_reason import UnsupportedReason, is_unsupported
|
||||
from lldbsuite.test_event import build_exception
|
||||
|
||||
|
||||
|
|
@ -162,10 +163,18 @@ class LLDBTestResult(unittest.TextTestResult):
|
|||
getattr(test, test._testMethodName).__func__.__unittest_skip__ = True
|
||||
getattr(
|
||||
test, test._testMethodName
|
||||
).__func__.__unittest_skip_why__ = (
|
||||
).__func__.__unittest_skip_why__ = UnsupportedReason(
|
||||
"test case does not fall in any category of interest for this run"
|
||||
)
|
||||
|
||||
def countUnsupported(self):
|
||||
"""Number of skipped tests that can never run in this configuration."""
|
||||
return sum(1 for _, reason in self.skipped if is_unsupported(reason))
|
||||
|
||||
def countSkipped(self):
|
||||
"""Number of skipped tests that ought to run here but don't work yet."""
|
||||
return len(self.skipped) - self.countUnsupported()
|
||||
|
||||
def checkExclusion(self, exclusion_list, name):
|
||||
if exclusion_list:
|
||||
import re
|
||||
|
|
@ -282,9 +291,13 @@ class LLDBTestResult(unittest.TextTestResult):
|
|||
method = getattr(test, "markSkippedTest", None)
|
||||
if method:
|
||||
method()
|
||||
# A test turned off by a `require*` decorator can never run in this
|
||||
# configuration, so report it as UNSUPPORTED. Anything else is a test
|
||||
# that ought to run here but doesn't work yet: report it as SKIPPED.
|
||||
status = "UNSUPPORTED" if is_unsupported(reason) else "SKIPPED"
|
||||
self.stream.write(
|
||||
"UNSUPPORTED: LLDB (%s) :: %s (%s) \n"
|
||||
% (self._config_string(test), str(test), reason)
|
||||
"%s: LLDB (%s) :: %s (%s) \n"
|
||||
% (status, self._config_string(test), str(test), reason)
|
||||
)
|
||||
|
||||
def addUnexpectedSuccess(self, test):
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class AArch64LinuxAArch32Compat(TestBase):
|
|||
@skipIfRemote
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipIfLLVMTargetMissing("ARM")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_aarch32_compat(self):
|
||||
self.build()
|
||||
test_program = self.getBuildArtifact("a.out")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class AArch64LinuxFPMR(TestBase):
|
|||
EXPECTED_FPMR_FIELDS = ["LSCALE2 = 42", "F8S1 = FP8_E4M3 | 0x4"]
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_fpmr_register_live(self):
|
||||
if not self.isAArch64FPMR():
|
||||
self.skipTest("FPMR must be present.")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class AArch64LinuxGCSTestCase(TestBase):
|
|||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_gcs_region(self):
|
||||
if not self.isAArch64GCS():
|
||||
self.skipTest("Target must support GCS.")
|
||||
|
|
@ -62,7 +62,7 @@ class AArch64LinuxGCSTestCase(TestBase):
|
|||
# cleanly if GCS was manually enabled.
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_gcs_fault(self):
|
||||
if not self.isAArch64GCS():
|
||||
self.skipTest("Target must support GCS.")
|
||||
|
|
@ -118,7 +118,7 @@ class AArch64LinuxGCSTestCase(TestBase):
|
|||
return gcs_features_enabled, gcs_features_locked, gcspr_el0
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_gcs_registers(self):
|
||||
if not self.isAArch64GCS():
|
||||
self.skipTest("Target must support GCS.")
|
||||
|
|
@ -239,7 +239,7 @@ class AArch64LinuxGCSTestCase(TestBase):
|
|||
],
|
||||
)
|
||||
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_gcs_expression_simple(self):
|
||||
if not self.isAArch64GCS():
|
||||
self.skipTest("Target must support GCS.")
|
||||
|
|
@ -303,7 +303,7 @@ class AArch64LinuxGCSTestCase(TestBase):
|
|||
self.expect(expr_cmd, substrs=["(unsigned long) 1"])
|
||||
self.check_gcs_registers(*before)
|
||||
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_gcs_expression_disable_gcs(self):
|
||||
if not self.isAArch64GCS():
|
||||
self.skipTest("Target must support GCS.")
|
||||
|
|
@ -343,7 +343,7 @@ class AArch64LinuxGCSTestCase(TestBase):
|
|||
enabled &= ~1
|
||||
self.check_gcs_registers(enabled, locked, spr_el0)
|
||||
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_gcs_expression_enable_gcs(self):
|
||||
if not self.isAArch64GCS():
|
||||
self.skipTest("Target must support GCS.")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class AArch64LinuxMTEMemoryRegionTestCase(TestBase):
|
|||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
@skipUnlessAArch64MTELinuxCompiler
|
||||
def test_mte_regions(self):
|
||||
if not self.isAArch64MTE():
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class AArch64LinuxMTEMemoryTagAccessTestCase(TestBase):
|
|||
)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
@skipUnlessAArch64MTELinuxCompiler
|
||||
def test_mte_tag_read(self):
|
||||
self.setup_mte_test()
|
||||
|
|
@ -209,7 +209,7 @@ class AArch64LinuxMTEMemoryTagAccessTestCase(TestBase):
|
|||
)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
@skipUnlessAArch64MTELinuxCompiler
|
||||
def test_mte_tag_write(self):
|
||||
self.setup_mte_test()
|
||||
|
|
@ -431,7 +431,7 @@ class AArch64LinuxMTEMemoryTagAccessTestCase(TestBase):
|
|||
)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
@skipUnlessAArch64MTELinuxCompiler
|
||||
def test_mte_memory_read_tag_display(self):
|
||||
self.setup_mte_test()
|
||||
|
|
@ -588,7 +588,7 @@ class AArch64LinuxMTEMemoryTagAccessTestCase(TestBase):
|
|||
)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
@skipUnlessAArch64MTELinuxCompiler
|
||||
# Repeating options currently does not work, see
|
||||
# https://github.com/llvm/llvm-project/issues/192057.
|
||||
|
|
@ -631,7 +631,7 @@ class AArch64LinuxMTEMemoryTagAccessTestCase(TestBase):
|
|||
)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
@skipUnlessAArch64MTELinuxCompiler
|
||||
def test_mte_memory_find(self):
|
||||
"""Test the --show-tags option with memory find."""
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class AArch64LinuxMTEMemoryTagFaultsTestCase(TestBase):
|
|||
)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
@skipUnlessAArch64MTELinuxCompiler
|
||||
def test_mte_tag_fault_sync(self):
|
||||
self.setup_mte_test("sync")
|
||||
|
|
@ -57,7 +57,7 @@ class AArch64LinuxMTEMemoryTagFaultsTestCase(TestBase):
|
|||
)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
@skipUnlessAArch64MTELinuxCompiler
|
||||
def test_mte_tag_fault_async(self):
|
||||
self.setup_mte_test("async")
|
||||
|
|
|
|||
|
|
@ -54,11 +54,11 @@ class AArch64LinuxNonAddressBitCodeBreak(TestBase):
|
|||
|
||||
# AArch64 Linux always enables the top byte ignore feature
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_software_break(self):
|
||||
self.do_tagged_break(False)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_hardware_break(self):
|
||||
self.do_tagged_break(True)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class AArch64LinuxNonAddressBitMemoryAccessTestCase(TestBase):
|
|||
self.expect("memory read {}".format(read_from), substrs=[data])
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_non_address_bit_memory_read_write_cmds(self):
|
||||
self.setup_test()
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ class AArch64LinuxNonAddressBitMemoryAccessTestCase(TestBase):
|
|||
self.assertEqual(data, buf_content)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_non_address_bit_memory_read_write_api_process(self):
|
||||
self.setup_test()
|
||||
buf, buf_with_non_address = self.get_ptr_values()
|
||||
|
|
@ -121,7 +121,7 @@ class AArch64LinuxNonAddressBitMemoryAccessTestCase(TestBase):
|
|||
self.assertEqual(0x5634120042444C4C, ptr)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_non_address_bit_memory_read_write_api_target(self):
|
||||
self.setup_test()
|
||||
buf, buf_with_non_address = self.get_ptr_values()
|
||||
|
|
@ -147,7 +147,7 @@ class AArch64LinuxNonAddressBitMemoryAccessTestCase(TestBase):
|
|||
# Read<type>FromMemory are in Target but not SBTarget so no tests for those.
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_non_address_bit_memory_caching(self):
|
||||
# The read/write tests above do exercise the cache but this test
|
||||
# only cares that the cache sees buf and buf_with_non_address
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class AArch64LinuxPOE(TestBase):
|
|||
)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_poe_live(self):
|
||||
if not self.isAArch64POE():
|
||||
self.skipTest("POE must be present.")
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class AArch64LinuxTaggedMemoryReadTestCase(TestBase):
|
|||
)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_tagged_memory_read(self):
|
||||
self.setup_test()
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ class AArch64LinuxTaggedMemoryReadTestCase(TestBase):
|
|||
self.expect("memory read", patterns=[tagged_addr_pattern], matching=False)
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_tagged_memory_find(self):
|
||||
self.setup_test()
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class AArch64LinuxTaggedMemoryRegionTestCase(TestBase):
|
|||
|
||||
# AArch64 Linux always enables the top byte ignore feature
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_mte_regions(self):
|
||||
self.build()
|
||||
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class AArch64LinuxTLSRegisters(TestBase):
|
|||
self.expect("p {}_was_set".format(register), substrs=["true"])
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_tls_no_sme(self):
|
||||
if self.isAArch64SME():
|
||||
self.skipTest("SME must not be present.")
|
||||
|
|
@ -104,7 +104,7 @@ class AArch64LinuxTLSRegisters(TestBase):
|
|||
self.check_tls_reg(["tpidr"])
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_tls_sme(self):
|
||||
if not self.isAArch64SME():
|
||||
self.skipTest("SME must be present.")
|
||||
|
|
@ -112,7 +112,7 @@ class AArch64LinuxTLSRegisters(TestBase):
|
|||
self.check_tls_reg(["tpidr", "tpidr2"])
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_tpidr2_no_sme(self):
|
||||
if self.isAArch64SME():
|
||||
self.skipTest("SME must not be present.")
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class UnwindSignalTestCase(TestBase):
|
|||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessArch("aarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_unwind_signal(self):
|
||||
"""Inferior calls sigill() and handles the resultant SIGILL.
|
||||
Stopped at a breakpoint in the handler, check that we can unwind
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class TargetSymbolsAddCommand(TestBase):
|
|||
self.source = "main.c"
|
||||
|
||||
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_target_symbols_add(self):
|
||||
"""Test that 'target symbols add' can load the symbols
|
||||
even if gnu.build-id and gnu_debuglink are not present in the module.
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
|
||||
@skipUnlessArch("arm")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
class ArmLinuxTLSRegister(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class TestLinkerSymbols(TestBase):
|
|||
NO_DEBUG_INFO_TESTCASE = True
|
||||
SHARED_BUILD_TESTCASE = False
|
||||
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_linker_symbols(self):
|
||||
build_dict = dict(LD_EXTRAS="-Wl,-T," + self.getSourcePath("linker.script"))
|
||||
self.build(dictionary=build_dict)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class LoongArch64LinuxRegisters(TestBase):
|
|||
self.expect("continue", substrs=["exited with status = 0"])
|
||||
|
||||
@skipUnlessArch("loongarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_lsx(self):
|
||||
"""Test read/write of LSX registers."""
|
||||
if not self.isLoongArchLSX():
|
||||
|
|
@ -86,7 +86,7 @@ class LoongArch64LinuxRegisters(TestBase):
|
|||
self.simd_registers_impl(Mode.LSX)
|
||||
|
||||
@skipUnlessArch("loongarch64")
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_lasx(self):
|
||||
"""Test read/write of LASX registers."""
|
||||
if not self.isLoongArchLASX():
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from lldbsuite.test import lldbutil
|
|||
class TestMixedDwarfBinary(TestBase):
|
||||
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
|
||||
@add_test_categories(["dwo"])
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
def test_mixed_dwarf(self):
|
||||
"""Test that 'frame variable' works
|
||||
for the executable built from two source files compiled
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
class TestTargetSymbolsSepDebugSymlink(TestBase):
|
||||
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
@skipIf(hostoslist=["windows"])
|
||||
@skipIfRemote # llvm.org/pr36237
|
||||
def test_target_symbols_sepdebug_symlink_case(self):
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from lldbsuite.test import lldbutil
|
|||
class CreateDuringInstructionStepTestCase(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessPlatform(["linux"])
|
||||
@requireLinux
|
||||
@expectedFailureAndroid("llvm.org/pr24737", archs=["arm$"])
|
||||
@skipIf(oslist=["linux"], archs=["arm$", "aarch64"], bugnumber="llvm.org/pr24737")
|
||||
def test_step_inst(self):
|
||||
|
|
|
|||
|
|
@ -127,6 +127,15 @@ class LLDBTest(TestFormat):
|
|||
expected_failures = parsed_details["expected failures"]
|
||||
unexpected_successes = parsed_details["unexpected successes"]
|
||||
|
||||
only_skipped = 0
|
||||
breakdown = re.search(
|
||||
r"^Skip breakdown \(unsupported=(\d+), skipped=(\d+)\)\r?$",
|
||||
err,
|
||||
re.MULTILINE,
|
||||
)
|
||||
if breakdown:
|
||||
only_skipped = int(breakdown.group(2))
|
||||
|
||||
non_pass = (
|
||||
failures + errors + skipped + expected_failures + unexpected_successes
|
||||
)
|
||||
|
|
@ -142,9 +151,11 @@ class LLDBTest(TestFormat):
|
|||
return lit.Test.XPASS, output
|
||||
else:
|
||||
# Aggregate the tests results with the following precedence:
|
||||
# PASS > XFAIL > UNSUPPORTED
|
||||
# PASS > XFAIL > SKIPPED > UNSUPPORTED
|
||||
if passes > 0:
|
||||
return lit.Test.PASS, output
|
||||
if expected_failures > 0:
|
||||
return lit.Test.XFAIL, output
|
||||
if only_skipped > 0:
|
||||
return lit.Test.SKIPPED, output
|
||||
return lit.Test.UNSUPPORTED, output
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from lldbsuite.test.lldbtest import *
|
|||
from lldbsuite.test import lldbutil
|
||||
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
class AddDsymDownload(TestBase):
|
||||
SHARED_BUILD_TESTCASE = False
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from lldbsuite.test.lldbtest import *
|
|||
from lldbsuite.test import lldbutil
|
||||
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
class AddDsymMidExecutionCommandCase(TestBase):
|
||||
SHARED_BUILD_TESTCASE = False
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from lldbsuite.test.lldbtest import *
|
|||
from lldbsuite.test import lldbutil
|
||||
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIf(archs=no_match(["arm64"]))
|
||||
class TestArmPointerMetadataStripping(TestBase):
|
||||
def test(self):
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
|
||||
class TestBSSOnlyDataSectionSliding(TestBase):
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_with_python_api(self):
|
||||
"""Test that we get thread names when interrupting a process."""
|
||||
self.build()
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
class TestCorefileExceptionReason(TestBase):
|
||||
@no_debug_info_test
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIf(archs=no_match(["arm64", "arm64e"]))
|
||||
@skipIfRemote
|
||||
def test(self):
|
||||
|
|
|
|||
|
|
@ -21,14 +21,14 @@ class TestCTF(TestBase):
|
|||
|
||||
@skipTestIfFn(no_ctf_convert)
|
||||
@skipTestIfFn(no_objcopy)
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test(self):
|
||||
self.build()
|
||||
self.do_test()
|
||||
|
||||
@skipTestIfFn(no_ctf_convert)
|
||||
@skipTestIfFn(no_objcopy)
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_compressed(self):
|
||||
self.build(dictionary={"COMPRESS_CTF": "YES"})
|
||||
self.do_test()
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
class TestCase(TestBase):
|
||||
@no_debug_info_test
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_abort(self):
|
||||
self.build()
|
||||
target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from lldbsuite.test.lldbtest import *
|
|||
from lldbsuite.test import lldbutil
|
||||
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfOutOfTreeDebugserver
|
||||
class TestCase(TestBase):
|
||||
def check_invalid_packet(self, packet_str):
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from lldbsuite.test import lldbutil
|
|||
class TestDelayInitDependencies(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIf(macos_version=["<", "15.0"])
|
||||
@skipIfRemote
|
||||
def test_delay_init_dependency(self):
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from lldbsuite.test import lldbutil
|
|||
class DenyAttachTestCase(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfDarwinEmbedded # PT_DENY_ATTACH attach behavior differs on ios/tvos/etc
|
||||
@skipIfAsan # Attach tests time out inconsistently under asan.
|
||||
def test_attach_to_deny_attach_process(self):
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ def has_lldb_codesign():
|
|||
return False
|
||||
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
class TestdSYMCodesign(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
SHARED_BUILD_TESTCASE = False
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from lldbsuite.test.lldbtest import *
|
|||
from lldbsuite.test.decorators import *
|
||||
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
class TestdSYMModuleInit(TestBase):
|
||||
SHARED_BUILD_TESTCASE = False
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class DyldTrieSymbolsTestCase(TestBase):
|
|||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_dyld_trie_symbols(self):
|
||||
"""Test that we make create symbol table entries from the dyld trie data structure."""
|
||||
self.build()
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from lldbsuite.test import lldbutil
|
|||
class TestEarlyProcessLaunch(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfAsan # rdar://103359354
|
||||
# until this feature is included in the system
|
||||
# debugserver.
|
||||
|
|
|
|||
|
|
@ -34,18 +34,18 @@ from lldbsuite.test.gdbclientutils import (
|
|||
class TestExpeditedStackMemory(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_no_packets_during_backtrace(self):
|
||||
"""With the memory cache on, the backtrace sends no packets at all."""
|
||||
self.check_packets_during_backtrace(disable_memory_cache=False)
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_memory_reads_during_backtrace_without_cache(self):
|
||||
"""With the memory cache off, the backtrace reads the backchain from the
|
||||
stub, producing memory-read packets."""
|
||||
self.check_packets_during_backtrace(disable_memory_cache=True)
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_memory_reads_when_examining_frame0_locals(self):
|
||||
"""Model an IDE stop: walk the whole stack (a backtrace / debug
|
||||
navigator) but examine the locals of only the selected frame 0.
|
||||
|
|
@ -54,7 +54,7 @@ class TestExpeditedStackMemory(TestBase):
|
|||
heap memory."""
|
||||
self.check_memory_reads_when_examining_locals(examine_all_frames=False)
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_memory_reads_when_examining_all_frames_locals(self):
|
||||
"""Model "view all frames": walk the whole stack and examine every
|
||||
frame's locals. This reads the same variety of memory across several
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ file_index = 0
|
|||
class TestExpeditedThreadPCs(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_expedited_thread_pcs(self):
|
||||
TestBase.setUp(self)
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class TestExtendedBacktraceAPI(TestBase):
|
|||
TestBase.setUp(self)
|
||||
self.main_source = "main.m"
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@add_test_categories(["objc", "pyapi"])
|
||||
def test_extended_backtrace_thread_api(self):
|
||||
"""Test GetExtendedBacktraceThread with queue debugging."""
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import lldbsuite.test.lldbplatformutil as lldbplatformutil
|
|||
from lldbsuite.test.lldbtest import *
|
||||
|
||||
|
||||
@decorators.skipUnlessDarwin
|
||||
@decorators.requireDarwin
|
||||
class FindAppInMacOSAppBundle(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class BundleWithDotInFilenameTestCase(TestBase):
|
|||
TestBase.tearDown(self)
|
||||
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
# This test is explicitly a dSYM test, it doesn't need to run for any other config.
|
||||
@skipIf(debug_info=no_match(["dsym"]))
|
||||
def test_attach_and_check_dsyms(self):
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class DeepBundleTestCase(TestBase):
|
|||
TestBase.tearDown(self)
|
||||
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
# This test is explicitly a dSYM test, it doesn't need to run for any other config.
|
||||
@skipIf(debug_info=no_match(["dsym"]))
|
||||
def test_attach_and_check_dsyms(self):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from lldbsuite.test.lldbtest import *
|
|||
|
||||
|
||||
class TestFunctionNameWithoutArgs(TestBase):
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@no_debug_info_test
|
||||
def test_function_name_without_args(self):
|
||||
self.build()
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class FunctionStartsTestCase(TestBase):
|
|||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIf(compiler="clang", compiler_version=["<", "13.0"])
|
||||
def test_function_starts_binary(self):
|
||||
"""Test that we make synthetic symbols when we have the binary."""
|
||||
|
|
@ -24,7 +24,7 @@ class FunctionStartsTestCase(TestBase):
|
|||
self.do_function_starts(False)
|
||||
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIf(compiler="clang", compiler_version=["<", "13.0"])
|
||||
def test_function_starts_no_binary(self):
|
||||
"""Test that we make synthetic symbols when we don't have the binary"""
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from lldbsuite.test.lldbtest import *
|
|||
class TestDarwinSignalHandlers(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_ignored_thread(self):
|
||||
"""It isn't possible to convert an EXC_BAD_ACCESS to a signal when
|
||||
running under the debugger, which makes debugging SIGBUS handlers
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class TestIndirectFunctions(TestBase):
|
|||
# Find the line numbers that we will step to in main:
|
||||
self.main_source = "main.c"
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@add_test_categories(["pyapi"])
|
||||
@skipIf(bugnumber="rdar://120796553")
|
||||
def test_with_python_api(self):
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from lldbsuite.test import lldbutil
|
|||
class TestMetadataRegisters(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfRemote
|
||||
def test_add_registers_via_metadata(self):
|
||||
self.build()
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class TestAddrableBitsCorefile(TestBase):
|
|||
self.corefile = self.getBuildArtifact("corefile")
|
||||
|
||||
@skipIf(archs=no_match(["arm64e"]))
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_lc_note_addrable_bits(self):
|
||||
self.initial_setup()
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class TestFirmwareCorefiles(TestBase):
|
|||
)
|
||||
@skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_lc_note_version_string(self):
|
||||
self.build()
|
||||
aout_exe_basename = "a.out"
|
||||
|
|
@ -120,7 +120,7 @@ class TestFirmwareCorefiles(TestBase):
|
|||
)
|
||||
@skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_lc_note_main_bin_spec(self):
|
||||
self.build()
|
||||
aout_exe_basename = "a.out"
|
||||
|
|
@ -233,7 +233,7 @@ class TestFirmwareCorefiles(TestBase):
|
|||
)
|
||||
@skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_lc_note_main_bin_spec_os_plugin(self):
|
||||
self.build()
|
||||
aout_exe = self.getBuildArtifact("a.out")
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class TestKernVerStrLCNOTE(TestBase):
|
|||
bugnumber="This test is looking explicitly for a dSYM",
|
||||
)
|
||||
@skipIf(archs=no_match(["x86_64"]))
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_lc_note(self):
|
||||
self.build()
|
||||
self.test_exe = self.getBuildArtifact("a.out")
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class TestMultipleBinaryCorefile(TestBase):
|
|||
|
||||
@skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_corefile_binaries_dsymforuuid(self):
|
||||
self.initial_setup()
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ class TestMultipleBinaryCorefile(TestBase):
|
|||
|
||||
@skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_corefile_binaries_preloaded(self):
|
||||
self.initial_setup()
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class TestMacCatalyst(TestBase):
|
|||
SHARED_BUILD_TESTCASE = False
|
||||
|
||||
@skipIf(macos_version=["<", "10.15"])
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfDarwinEmbedded
|
||||
def test_macabi(self):
|
||||
"""Test the x86_64-apple-ios-macabi target linked against a macos dylib"""
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import os
|
|||
|
||||
class TestMacCatalystAppWithMacOSFramework(TestBase):
|
||||
@skipIf(macos_version=["<", "10.15"])
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfDarwinEmbedded
|
||||
# There is a Clang driver change missing on llvm.org.
|
||||
@expectedFailureAll(bugnumber="rdar://problem/54986190>")
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import lldbsuite.test.cpu_feature as cpu_feature
|
|||
exe_name = "uaf" # Must match Makefile
|
||||
|
||||
|
||||
@skipIfWasm # memory tagging is a Darwin AArch64 feature
|
||||
@requireNotWasm # memory tagging is a Darwin AArch64 feature
|
||||
class TestDarwinMTE(TestBase):
|
||||
SHARED_BUILD_TESTCASE = False
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class NoNlistsTestCase(TestBase):
|
|||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_no_nlist_symbols(self):
|
||||
self.build()
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class DarwinNSLogOutputTestCase(TestBase):
|
|||
|
||||
@skipIfAsan # avoid dealing with pexpect timeout flakyness on bots
|
||||
@skipIf(oslist=["linux"], archs=["arm$", "aarch64"])
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfRemote # this test is currently written using lldb commands & assumes running on local system
|
||||
def test_nslog_output_is_displayed(self):
|
||||
"""Test that NSLog() output shows up in the command-line debugger."""
|
||||
|
|
@ -136,7 +136,7 @@ class DarwinNSLogOutputTestCase(TestBase):
|
|||
|
||||
@skipIfAsan # avoid dealing with pexpect timeout flakyness on bots
|
||||
@skipIf(oslist=["linux"], archs=["arm$", "aarch64"])
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfRemote # this test is currently written using lldb commands & assumes running on local system
|
||||
def test_nslog_output_is_suppressed_with_env_var(self):
|
||||
"""Test that NSLog() output does not show up with the ignore env var."""
|
||||
|
|
|
|||
|
|
@ -11,14 +11,14 @@ from lldbsuite.test.lldbtest import *
|
|||
class TestObjCRecognizer(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_exception_recognizer_sub_class(self):
|
||||
"""There can be many tests in a test case - describe this test here."""
|
||||
self.build()
|
||||
self.main_source_file = lldb.SBFileSpec("main.m")
|
||||
self.objc_recognizer_test(True)
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_exception_recognizer_plain(self):
|
||||
"""There can be many tests in a test case - describe this test here."""
|
||||
self.build()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
|
||||
class OrderFileTestCase(TestBase):
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test(self):
|
||||
"""Test debug symbols follow the correct order by the order file."""
|
||||
self.build()
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class TestLaunchProcessPosixSpawn(TestBase):
|
|||
self.assertState(process.GetState(), lldb.eStateExited)
|
||||
self.assertIn("slice: {}".format(arch), process.GetSTDOUT(1000))
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfDarwinEmbedded
|
||||
@skipIfLLVMTargetMissing("AArch64")
|
||||
@skipIfLLVMTargetMissing("X86")
|
||||
|
|
@ -60,7 +60,7 @@ class TestLaunchProcessPosixSpawn(TestBase):
|
|||
self.run_arch(exe, "x86_64")
|
||||
self.run_arch(exe, "x86_64h")
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIf(bugnumber="rdar://170040996")
|
||||
@skipIfDarwinEmbedded
|
||||
@skipIfLLVMTargetMissing("AArch64")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import signal
|
|||
class TestDetachVrsProfile(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfRemote
|
||||
def test_profile_and_detach(self):
|
||||
"""There can be many tests in a test case - describe this test here."""
|
||||
|
|
|
|||
|
|
@ -9,20 +9,20 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
|
||||
class TestQueues(TestBase):
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@add_test_categories(["pyapi"])
|
||||
def test_with_python_api_queues(self):
|
||||
"""Test queues inspection SB APIs."""
|
||||
self.build()
|
||||
self.queues()
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@add_test_categories(["pyapi"])
|
||||
def test_queue_specific_breakpoints(self):
|
||||
self.build()
|
||||
self.queue_specific_breakpoints()
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@add_test_categories(["pyapi"])
|
||||
def test_with_python_api_queues_with_backtrace(self):
|
||||
"""Test queues inspection SB APIs."""
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
|
||||
class TestSafeFuncCalls(TestBase):
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@add_test_categories(["pyapi"])
|
||||
def test_with_python_api(self):
|
||||
"""Test function call thread safety."""
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class TestSaveCrashlog(TestBase):
|
|||
# each debug info format.
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_save_crashlog(self):
|
||||
"""There can be many tests in a test case - describe this test here."""
|
||||
self.build()
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from lldbsuite.test import lldbutil
|
|||
class SharedCacheHostMemoryTestCase(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfRemote
|
||||
def test_host_lldb_memory(self):
|
||||
"""Stop in a shared cache binary loaded from lldb's own memory and
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class SharedCacheVMRangeTestCase(TestBase):
|
|||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipIfRemote
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfOutOfTreeDebugserver # debugserver returns shared_cache_size
|
||||
def test_shared_cache_vm_range(self):
|
||||
"""Test that the shared cache VM range contains a known libc function"""
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class TestSimulatorPlatformLaunching(TestBase):
|
|||
)
|
||||
|
||||
@skipIfAsan
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfDarwinEmbedded
|
||||
@apple_simulator_test("iphone")
|
||||
@skipIf(archs=["x86_64"])
|
||||
|
|
@ -114,7 +114,7 @@ class TestSimulatorPlatformLaunching(TestBase):
|
|||
)
|
||||
|
||||
@skipIfAsan
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfDarwinEmbedded
|
||||
@apple_simulator_test("appletv")
|
||||
@skipIf(archs=["x86_64"])
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class TestSkinnyCorefile(TestBase):
|
|||
debug_info=no_match(["dsym"]),
|
||||
bugnumber="This test is looking explicitly for a dSYM",
|
||||
)
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfRemote
|
||||
def test_lc_note(self):
|
||||
self.build()
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class TestSMERegistersDarwin(TestBase):
|
|||
NO_DEBUG_INFO_TESTCASE = True
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipUnlessFeature(cpu_feature.AArch64.SME)
|
||||
@skipUnlessFeature(cpu_feature.AArch64.SME2)
|
||||
# thread_set_state/thread_get_state only avail in macOS 15.4+
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
class TestStackCorefile(TestBase):
|
||||
@no_debug_info_test
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfRemote
|
||||
def test(self):
|
||||
corefile = self.getBuildArtifact("process.core")
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from lldbsuite.test.decorators import *
|
|||
class TestMachExceptionData(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_exc_bad_access(self):
|
||||
"""Test that we get type 1, code 1 and the right address for
|
||||
a EXC_BAD_ACCESS mach exception."""
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class TestTBIHonored(TestBase):
|
|||
# This test is valid on AArch64 systems with TBI mode enabled,
|
||||
# and an address mask that clears the top byte before reading
|
||||
# from memory.
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIf(archs=no_match(["arm64", "arm64e"]))
|
||||
@skipIfRemote
|
||||
def test(self):
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from lldbsuite.test import lldbutil
|
|||
class TestInterruptThreadNames(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@add_test_categories(["pyapi"])
|
||||
def test_with_python_api(self):
|
||||
"""Test that we get thread names when interrupting a process."""
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
|
||||
class TestInterruptThreadNames(TestBase):
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_internal_bps_resolved(self):
|
||||
self.build()
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ class TestInterruptThreadNames(TestBase):
|
|||
num_resolved += bp.GetNumResolvedLocations()
|
||||
self.assertGreater(num_resolved, 0)
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_internal_bps_deleted_on_relaunch(self):
|
||||
self.build()
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from lldbsuite.test.lldbtest import *
|
|||
class TestSuspendedThreadHandling(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test_suspended_threads(self):
|
||||
"""Test that debugserver doesn't disturb the suspend count of a thread
|
||||
that has been suspended from within a program, when navigating breakpoints
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class UniversalTestCase(TestBase):
|
|||
self.line = line_number("main.c", "// Set break point at this line.")
|
||||
|
||||
@add_test_categories(["pyapi"])
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@unittest.skipUnless(
|
||||
hasattr(os, "uname") and os.uname()[4] in ["x86_64"], "requires x86_64"
|
||||
)
|
||||
|
|
@ -49,7 +49,7 @@ class UniversalTestCase(TestBase):
|
|||
process = target.LaunchSimple(None, None, self.get_process_working_directory())
|
||||
self.assertTrue(process, PROCESS_IS_VALID)
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@unittest.skipUnless(
|
||||
hasattr(os, "uname") and os.uname()[4] in ["x86_64"], "requires x86_64"
|
||||
)
|
||||
|
|
@ -112,7 +112,7 @@ class UniversalTestCase(TestBase):
|
|||
self.expect("image list -A -b", substrs=["x86_64h testit"])
|
||||
self.runCmd("continue")
|
||||
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@unittest.skipUnless(
|
||||
hasattr(os, "uname") and os.uname()[4] in ["x86_64"], "requires x86_64"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class Universal64TestCase(TestBase):
|
|||
# The Makefile manually invokes clang.
|
||||
@skipIfLLVMTargetMissing("X86")
|
||||
@skipIfAsan
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfDarwinEmbedded
|
||||
def test_universal64_executable(self):
|
||||
"""Test fat64 universal executable"""
|
||||
|
|
@ -30,7 +30,7 @@ class Universal64TestCase(TestBase):
|
|||
# The Makefile manually invokes clang.
|
||||
@skipIfLLVMTargetMissing("X86")
|
||||
@skipIfAsan
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
@skipIfDarwinEmbedded
|
||||
def test_universal64_dsym(self):
|
||||
"""Test fat64 universal dSYM"""
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class TestUnregisteredMacho(TestBase):
|
|||
# newer debugserver required for jGetLoadedDynamicLibrariesInfos
|
||||
# to support this
|
||||
@no_debug_info_test
|
||||
@skipUnlessDarwin
|
||||
@requireDarwin
|
||||
def test(self):
|
||||
self.build()
|
||||
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class ConPTYTestCase(TestBase):
|
|||
|
||||
return process.GetSTDOUT(1 << 20)
|
||||
|
||||
@skipUnlessWindows
|
||||
@requireWindows
|
||||
@skipUnlessWindowsConPTY2022
|
||||
@skipIf(oslist=["windows"], archs=["aarch64"], bugnumber="#194069")
|
||||
def test_stdout_delivery(self):
|
||||
|
|
@ -72,7 +72,7 @@ class ConPTYTestCase(TestBase):
|
|||
output = self._strip_output(output)
|
||||
self.assertIn("Hello from ConPTY\r\n", output)
|
||||
|
||||
@skipUnlessWindows
|
||||
@requireWindows
|
||||
@skipUnlessWindowsConPTY2022
|
||||
@skipIf(oslist=["windows"], archs=["aarch64"], bugnumber="#194069")
|
||||
def test_large_output(self):
|
||||
|
|
@ -90,7 +90,7 @@ class ConPTYTestCase(TestBase):
|
|||
for i, line in enumerate(output_lines):
|
||||
self.assertEqual("line %04d" % i, line)
|
||||
|
||||
@skipUnlessWindows
|
||||
@requireWindows
|
||||
@skipUnlessWindowsConPTY
|
||||
@skipIf(oslist=["windows"], archs=["aarch64"], bugnumber="#194069")
|
||||
def test_basic_output_without_vt_check(self):
|
||||
|
|
@ -107,7 +107,7 @@ class ConPTYTestCase(TestBase):
|
|||
stripped = re.sub(r"\x1b\[[0-9;?]*[A-Za-z]", "", output)
|
||||
self.assertIn("Hello from ConPTY", stripped)
|
||||
|
||||
@skipUnlessWindows
|
||||
@requireWindows
|
||||
@skipUnlessWindowsConPTY2022
|
||||
@skipIf(oslist=["windows"], archs=["aarch64"], bugnumber="#194069")
|
||||
def test_no_screen_clear_on_init(self):
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from lldbsuite.test.lldbtest import *
|
|||
from typing import List
|
||||
|
||||
|
||||
@skipUnlessWindows
|
||||
@requireWindows
|
||||
class DebugHeapTestCase(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
@skipIfTargetDoesNotSupportSharedLibraries()
|
||||
class MissingDllTestCase(TestBase):
|
||||
@skipUnlessWindows
|
||||
@requireWindows
|
||||
def test(self):
|
||||
"""
|
||||
Test that lldb reports the application's exit code (STATUS_DLL_NOT_FOUND),
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import os
|
|||
class ReplaceDllTestCase(TestBase):
|
||||
SHARED_BUILD_TESTCASE = False
|
||||
|
||||
@skipUnlessWindows
|
||||
@requireWindows
|
||||
def test(self):
|
||||
"""
|
||||
Test that LLDB unlocks module files once all references are released.
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from lldbsuite.test import lldbutil
|
|||
class TestMSVCRTCException(TestBase):
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@skipUnlessPlatform(["windows"])
|
||||
@requireWindows
|
||||
@skipUnlessMSVC
|
||||
def test_msvc_runtime_checks(self):
|
||||
"""Test that lldb prints MSVC's runtime checks exceptions as stop reasons."""
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from lldbsuite.test import lldbutil
|
|||
|
||||
|
||||
class TestThreadName(TestBase):
|
||||
@skipUnlessWindows
|
||||
@requireWindows
|
||||
@skipIfWindows(windows_version=["<", "10.0.14393"])
|
||||
def test_with_thread_description(self):
|
||||
"""SBThread.GetName() reflects SetThreadDescription on Windows."""
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ class XunitReport(Report):
|
|||
if code == lit.Test.EXCLUDED:
|
||||
return "Test not selected (--filter, --max-tests)"
|
||||
if code == lit.Test.SKIPPED:
|
||||
return "User interrupt"
|
||||
return "Skipped"
|
||||
|
||||
assert code == lit.Test.UNSUPPORTED
|
||||
features = test.getMissingRequiredFeatures()
|
||||
|
|
|
|||
Loading…
Reference in a new issue