[Lldb-commits] [lldb] bf02bcf - [lldb/Test] Modify more tests for API replay
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu May 14 17:58:54 PDT 2020
Author: Jonas Devlieghere
Date: 2020-05-14T17:58:27-07:00
New Revision: bf02bcffcfd7dc965e930c6a3035895823d2d78b
URL: https://github.com/llvm/llvm-project/commit/bf02bcffcfd7dc965e930c6a3035895823d2d78b
DIFF: https://github.com/llvm/llvm-project/commit/bf02bcffcfd7dc965e930c6a3035895823d2d78b.diff
LOG: [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.
Added:
Modified:
lldb/packages/Python/lldbsuite/test/configuration.py
lldb/test/API/commands/process/attach/attach_denied/TestAttachDenied.py
lldb/test/API/commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandPython.py
lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
lldb/test/API/functionalities/breakpoint/objc/TestObjCBreakpoints.py
Removed:
################################################################################
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index 53f587b47db8..0439c4e8f1ac 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -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
diff --git a/lldb/test/API/commands/process/attach/attach_denied/TestAttachDenied.py b/lldb/test/API/commands/process/attach/attach_denied/TestAttachDenied.py
index dcd73da42e9e..a7565ccfeb75 100644
--- a/lldb/test/API/commands/process/attach/attach_denied/TestAttachDenied.py
+++ b/lldb/test/API/commands/process/attach/attach_denied/TestAttachDenied.py
@@ -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()
diff --git a/lldb/test/API/commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandPython.py b/lldb/test/API/commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandPython.py
index 956ec29809c8..f09839d62976 100644
--- a/lldb/test/API/commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandPython.py
+++ b/lldb/test/API/commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandPython.py
@@ -96,6 +96,7 @@ def test_watchpoint_command(self):
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)
diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py b/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
index 40a20a04b76b..f9d5aeeeb3b2 100644
--- a/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
+++ b/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
@@ -13,6 +13,7 @@ class BreakpointSetRestart(TestBase):
BREAKPOINT_TEXT = 'Set a breakpoint here'
@skipIfNetBSD
+ @skipIfReproducer
def test_breakpoint_set_restart(self):
self.build()
diff --git a/lldb/test/API/functionalities/breakpoint/objc/TestObjCBreakpoints.py b/lldb/test/API/functionalities/breakpoint/objc/TestObjCBreakpoints.py
index 0491d1f10031..4d1fe0e1036e 100644
--- a/lldb/test/API/functionalities/breakpoint/objc/TestObjCBreakpoints.py
+++ b/lldb/test/API/functionalities/breakpoint/objc/TestObjCBreakpoints.py
@@ -120,6 +120,10 @@ def check_objc_breakpoints(self, have_dsym):
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(
More information about the lldb-commits
mailing list