[lldb/Test] Modify more tests for API replay

Skip tests or parts thereof that aren't expected to work when run from a
reproducer. Also improve the doc comments in configuration.py to prevent
mistakes in the future.
This commit is contained in:
Jonas Devlieghere 2020-05-14 17:57:10 -07:00
parent 5df55bc7a4
commit bf02bcffcf
5 changed files with 17 additions and 1 deletions

View File

@ -163,6 +163,15 @@ def get_filecheck_path():
def is_reproducer_replay():
"""
Returns true when test is replayed from a reproducer.
Returns true when dotest is being replayed from a reproducer. Never use
this method to guard SB API calls as it will cause a divergence between
capture and replay.
"""
return replay_path is not None
def is_reproducer():
"""
Returns true when dotest is capturing a reproducer or is being replayed
from a reproducer. Use this method to guard SB API calls.
"""
return capture_path or replay_path

View File

@ -21,6 +21,7 @@ class AttachDeniedTestCase(TestBase):
@skipIfWindows
@skipIfiOSSimulator
@skipIfDarwinEmbedded # ptrace(ATTACH_REQUEST...) won't work on ios/tvos/etc
@skipIfReproducer
def test_attach_to_process_by_id_denied(self):
"""Test attach by process id denied"""
self.build()

View File

@ -96,6 +96,7 @@ class WatchpointPythonCommandTestCase(TestBase):
substrs=['(int32_t)', 'cookie = 777'])
@skipIfFreeBSD # timing out on buildbot
@skipIfReproducer
def test_continue_in_watchpoint_command(self):
"""Test continue in a watchpoint command."""
self.build(dictionary=self.d)

View File

@ -13,6 +13,7 @@ class BreakpointSetRestart(TestBase):
BREAKPOINT_TEXT = 'Set a breakpoint here'
@skipIfNetBSD
@skipIfReproducer
def test_breakpoint_set_restart(self):
self.build()

View File

@ -120,6 +120,10 @@ class TestObjCBreakpoints(TestBase):
self.check_category_breakpoints()
# Stop here for reproducers. They don't capture file system changes.
if configuration.is_reproducer():
return
if have_dsym:
shutil.rmtree(exe + ".dSYM")
self.assertEqual(subprocess.call(