From e7c91e3124b66cb1454a45dfd75c0a350852d6a6 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Thu, 14 May 2020 10:37:50 -0700 Subject: [PATCH] [lldb/Test] Skip remaining 'side_effect' tests with reproducers. The side_effect Python package bypasses the reproducer instrumentation and therefore these tests are not expected to replay from a reproducer. --- .../TestBreakpointCommandsFromPython.py | 18 ++++++++++-------- .../serialize/TestBreakpointSerialization.py | 14 ++++++++++---- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py b/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py index 15a3120..5a6e94d 100644 --- a/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py +++ b/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py @@ -18,16 +18,18 @@ class PythonBreakpointCommandSettingTestCase(TestBase): NO_DEBUG_INFO_TESTCASE = True @add_test_categories(['pyapi']) + @skipIfReproducer # side_effect bypasses reproducer def test_step_out_python(self): """Test stepping out using a python breakpoint command.""" self.build() self.do_set_python_command_from_python() + @skipIfReproducer # side_effect bypasses reproducer def test_bkpt_cmd_bad_arguments(self): """Test what happens when pass structured data to a command:""" self.build() self.do_bad_args_to_python_command() - + def setUp(self): TestBase.setUp(self) self.main_source = "main.c" @@ -93,7 +95,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase): (error.GetCString())) self.expect("command script import --allow-reload ./bktptcmd.py") - + func_bkpt.SetScriptCallbackFunction("bktptcmd.function") extra_args = lldb.SBStructuredData() @@ -102,11 +104,11 @@ class PythonBreakpointCommandSettingTestCase(TestBase): extra_args.SetFromJSON(stream) error = fancy_bkpt.SetScriptCallbackFunction("bktptcmd.another_function", extra_args) self.assertTrue(error.Success(), "Failed to add callback %s"%(error.GetCString())) - + stream.Clear() stream.Print('{"side_effect" : "I am so much fancier"}') extra_args.SetFromJSON(stream) - + # Fancier's callback is set up from the command line id = fancier_bkpt.GetID() self.expect("breakpoint command add -F bktptcmd.a_third_function -k side_effect -v 'I am fancier' %d"%(id)) @@ -115,14 +117,14 @@ class PythonBreakpointCommandSettingTestCase(TestBase): empty_args = lldb.SBStructuredData() error = not_so_fancy_bkpt.SetScriptCallbackFunction("bktptcmd.empty_extra_args", empty_args) self.assertTrue(error.Success(), "Failed to add callback %s"%(error.GetCString())) - + # Clear out canary variables side_effect.bktptcmd = None side_effect.callback = None side_effect.fancy = None side_effect.fancier = None side_effect.not_so_fancy = None - + # Now launch the process, and do not stop at entry point. self.process = self.target.LaunchSimple( None, None, self.get_process_working_directory()) @@ -157,7 +159,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase): # Pass a breakpoint command function that doesn't take extra_args, # but pass it extra args: - + extra_args = lldb.SBStructuredData() stream = lldb.SBStream() stream.Print('{"side_effect" : "I am fancy"}') @@ -171,4 +173,4 @@ class PythonBreakpointCommandSettingTestCase(TestBase): error = bkpt.SetScriptCallbackFunction("bktptcmd.nosuch_function", extra_args) self.assertTrue(error.Fail(), "Can't pass extra args if the function doesn't exist.") - + diff --git a/lldb/test/API/functionalities/breakpoint/serialize/TestBreakpointSerialization.py b/lldb/test/API/functionalities/breakpoint/serialize/TestBreakpointSerialization.py index 4c6f32b..afeccbe 100644 --- a/lldb/test/API/functionalities/breakpoint/serialize/TestBreakpointSerialization.py +++ b/lldb/test/API/functionalities/breakpoint/serialize/TestBreakpointSerialization.py @@ -15,41 +15,47 @@ class BreakpointSerialization(TestBase): NO_DEBUG_INFO_TESTCASE = True @add_test_categories(['pyapi']) + @skipIfReproducer # side_effect bypasses reproducer def test_resolvers(self): """Use Python APIs to test that we serialize resolvers.""" self.build() self.setup_targets_and_cleanup() self.do_check_resolvers() + @skipIfReproducer # side_effect bypasses reproducer def test_filters(self): """Use Python APIs to test that we serialize search filters correctly.""" self.build() self.setup_targets_and_cleanup() self.do_check_filters() + @skipIfReproducer # side_effect bypasses reproducer def test_options(self): """Use Python APIs to test that we serialize breakpoint options correctly.""" self.build() self.setup_targets_and_cleanup() self.do_check_options() + @skipIfReproducer # side_effect bypasses reproducer def test_appending(self): """Use Python APIs to test that we serialize breakpoint options correctly.""" self.build() self.setup_targets_and_cleanup() self.do_check_appending() + @skipIfReproducer # side_effect bypasses reproducer def test_name_filters(self): """Use python APIs to test that reading in by name works correctly.""" self.build() self.setup_targets_and_cleanup() self.do_check_names() - + + @skipIfReproducer # side_effect bypasses reproducer def test_scripted_extra_args(self): self.build() self.setup_targets_and_cleanup() self.do_check_extra_args() - + def setup_targets_and_cleanup(self): def cleanup (): self.RemoveTempFile(self.bkpts_file_path) @@ -328,13 +334,13 @@ class BreakpointSerialization(TestBase): self.copy_target.DeleteAllBreakpoints() # Now try one with extra args: - + extra_args = lldb.SBStructuredData() stream = lldb.SBStream() stream.Print('{"first_arg" : "first_value", "second_arg" : "second_value"}') extra_args.SetFromJSON(stream) self.assertTrue(extra_args.IsValid(), "SBStructuredData is valid.") - + bkpt = self.orig_target.BreakpointCreateFromScript("resolver.Resolver", extra_args, lldb.SBFileSpecList(), lldb.SBFileSpecList()) self.assertTrue(bkpt.IsValid(), "Bkpt is valid") -- 2.7.4