[Lldb-commits] [lldb] 8c0ff17 - [lldb/Test] Add @skipIfReproducer to tests using lldb::FileSP.

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu May 7 11:25:04 PDT 2020


Author: Jonas Devlieghere
Date: 2020-05-07T11:17:00-07:00
New Revision: 8c0ff17c3bb44edf455a2964e6035f28be68c9f3

URL: https://github.com/llvm/llvm-project/commit/8c0ff17c3bb44edf455a2964e6035f28be68c9f3
DIFF: https://github.com/llvm/llvm-project/commit/8c0ff17c3bb44edf455a2964e6035f28be68c9f3.diff

LOG: [lldb/Test] Add @skipIfReproducer to tests using lldb::FileSP.

lldb::FileSP is a typedef for std::shared_ptr<lldb_private::File> and
the reproducers cannot instrument a lldb_private constructor.

Added: 
    

Modified: 
    lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
    lldb/test/API/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
    lldb/test/API/python_api/file_handle/TestFileHandle.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py b/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
index f209261f0500..3e1abc3353c3 100644
--- a/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
+++ b/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
@@ -29,6 +29,7 @@ def process_from_yaml(self, yaml_file):
         self.process = self.target.LoadCore(minidump_path)
         return self.process
 
+    @skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def check_state(self):
         with open(os.devnull) as devnul:
             # sanitize test output

diff  --git a/lldb/test/API/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py b/lldb/test/API/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
index e4d085de7c2b..fd5c9ec59ea9 100644
--- a/lldb/test/API/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
+++ b/lldb/test/API/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
@@ -20,6 +20,7 @@ class Disassemble_VST1_64(TestBase):
     @add_test_categories(['pyapi'])
     @no_debug_info_test
     @skipIfLLVMTargetMissing("ARM")
+    @skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_disassemble_invalid_vst_1_64_raw_data(self):
         """Test disassembling invalid vst1.64 raw bytes with the API."""
         # Create a target from the debugger.

diff  --git a/lldb/test/API/python_api/file_handle/TestFileHandle.py b/lldb/test/API/python_api/file_handle/TestFileHandle.py
index 550aad2ad8a1..98e8847467a0 100644
--- a/lldb/test/API/python_api/file_handle/TestFileHandle.py
+++ b/lldb/test/API/python_api/file_handle/TestFileHandle.py
@@ -120,6 +120,7 @@ def handleCmd(self, cmd, check=True, collect_result=True):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_legacy_file_out_script(self):
         with open(self.out_filename, 'w') as f:
             self.dbg.SetOutputFileHandle(f, False)
@@ -135,6 +136,7 @@ def test_legacy_file_out_script(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_legacy_file_out(self):
         with open(self.out_filename, 'w') as f:
             self.dbg.SetOutputFileHandle(f, False)
@@ -143,6 +145,7 @@ def test_legacy_file_out(self):
             self.assertIn('deadbeef', f.read())
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_legacy_file_err_with_get(self):
         with open(self.out_filename, 'w') as f:
             self.dbg.SetErrorFileHandle(f, False)
@@ -157,6 +160,7 @@ def test_legacy_file_err_with_get(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_legacy_file_err(self):
         with open(self.out_filename, 'w') as f:
             self.dbg.SetErrorFileHandle(f, False)
@@ -166,6 +170,7 @@ def test_legacy_file_err(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_legacy_file_error(self):
         with open(self.out_filename, 'w') as f:
             self.dbg.SetErrorFileHandle(f, False)
@@ -175,6 +180,7 @@ def test_legacy_file_error(self):
             self.assertTrue(re.search(r'error:.*lolwut', errors))
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_type_errors(self):
         sbf = lldb.SBFile()
         self.assertRaises(Exception, sbf.Write, None)
@@ -185,6 +191,7 @@ def test_sbfile_type_errors(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_write_fileno(self):
         with open(self.out_filename, 'w') as f:
             sbf = lldb.SBFile(f.fileno(), "w", False)
@@ -199,6 +206,7 @@ def test_sbfile_write_fileno(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_write(self):
         with open(self.out_filename, 'w') as f:
             sbf = lldb.SBFile(f)
@@ -212,6 +220,7 @@ def test_sbfile_write(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_read_fileno(self):
         with open(self.out_filename, 'w') as f:
             f.write('FOO')
@@ -225,6 +234,7 @@ def test_sbfile_read_fileno(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_read(self):
         with open(self.out_filename, 'w') as f:
             f.write('foo')
@@ -240,6 +250,7 @@ def test_sbfile_read(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_fileno_out(self):
         with open(self.out_filename, 'w') as f:
             sbf = lldb.SBFile(f.fileno(), "w", False)
@@ -254,6 +265,7 @@ def test_fileno_out(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_fileno_help(self):
         with open(self.out_filename, 'w') as f:
             sbf = lldb.SBFile(f.fileno(), "w", False)
@@ -265,6 +277,7 @@ def test_fileno_help(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_help(self):
         with open(self.out_filename, 'w') as f:
             status = self.dbg.SetOutputFile(lldb.SBFile(f))
@@ -275,6 +288,7 @@ def test_help(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_immediate(self):
         with open(self.out_filename, 'w') as f:
             ret = lldb.SBCommandReturnObject()
@@ -292,6 +306,7 @@ def test_immediate(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_immediate_string(self):
         f = io.StringIO()
         ret = lldb.SBCommandReturnObject()
@@ -308,6 +323,7 @@ def test_immediate_string(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_immediate_sbfile_string(self):
         f = io.StringIO()
         ret = lldb.SBCommandReturnObject()
@@ -322,6 +338,7 @@ def test_immediate_sbfile_string(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_fileno_inout(self):
         with open(self.in_filename, 'w') as f:
             f.write("help help\n")
@@ -345,6 +362,7 @@ def test_fileno_inout(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_inout(self):
         with open(self.in_filename, 'w') as f:
             f.write("help help\n")
@@ -363,6 +381,7 @@ def test_inout(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_binary_inout(self):
         with open(self.in_filename, 'w') as f:
             f.write("help help\n")
@@ -382,6 +401,7 @@ def test_binary_inout(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_string_inout(self):
         inf = io.StringIO("help help\np/x ~0\n")
         outf = io.StringIO()
@@ -399,6 +419,7 @@ def test_string_inout(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_bytes_inout(self):
         inf = io.BytesIO(b"help help\nhelp b\n")
         outf = io.BytesIO()
@@ -415,6 +436,7 @@ def test_bytes_inout(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_fileno_error(self):
         with open(self.out_filename, 'w') as f:
 
@@ -433,6 +455,7 @@ def test_fileno_error(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_replace_stdout(self):
         f = io.StringIO()
         with replace_stdout(f):
@@ -443,6 +466,7 @@ def test_replace_stdout(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_replace_stdout_with_nonfile(self):
         f = io.StringIO()
         with replace_stdout(f):
@@ -458,6 +482,7 @@ class Nothing():
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_write_borrowed(self):
         with open(self.out_filename, 'w') as f:
             sbf = lldb.SBFile.Create(f, borrow=True)
@@ -474,6 +499,7 @@ def test_sbfile_write_borrowed(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_write_forced(self):
         with open(self.out_filename, 'w') as f:
             written = MutableBool(False)
@@ -495,6 +521,7 @@ def mywrite(x):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_write_forced_borrowed(self):
         with open(self.out_filename, 'w') as f:
             written = MutableBool(False)
@@ -516,6 +543,7 @@ def mywrite(x):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_write_string(self):
         f = io.StringIO()
         sbf = lldb.SBFile(f)
@@ -529,6 +557,7 @@ def test_sbfile_write_string(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_string_out(self):
         f = io.StringIO()
         status = self.dbg.SetOutputFile(f)
@@ -539,6 +568,7 @@ def test_string_out(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_string_error(self):
         f = io.StringIO()
         status = self.dbg.SetErrorFile(f)
@@ -550,6 +580,7 @@ def test_string_error(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_write_bytes(self):
         f = io.BytesIO()
         sbf = lldb.SBFile(f)
@@ -562,6 +593,7 @@ def test_sbfile_write_bytes(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_read_string(self):
         f = io.StringIO('zork')
         sbf = lldb.SBFile(f)
@@ -573,6 +605,7 @@ def test_sbfile_read_string(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_read_string_one_byte(self):
         f = io.StringIO('z')
         sbf = lldb.SBFile(f)
@@ -585,6 +618,7 @@ def test_sbfile_read_string_one_byte(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_read_bytes(self):
         f = io.BytesIO(b'zork')
         sbf = lldb.SBFile(f)
@@ -596,6 +630,7 @@ def test_sbfile_read_bytes(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_out(self):
         with open(self.out_filename, 'w') as f:
             sbf = lldb.SBFile(f)
@@ -608,6 +643,7 @@ def test_sbfile_out(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_file_out(self):
         with open(self.out_filename, 'w') as f:
             status = self.dbg.SetOutputFile(f)
@@ -618,6 +654,7 @@ def test_file_out(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbfile_error(self):
         with open(self.out_filename, 'w') as f:
             sbf = lldb.SBFile(f)
@@ -630,6 +667,7 @@ def test_sbfile_error(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_file_error(self):
         with open(self.out_filename, 'w') as f:
             status = self.dbg.SetErrorFile(f)
@@ -641,6 +679,7 @@ def test_file_error(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_exceptions(self):
         self.assertRaises(Exception, lldb.SBFile, None)
         self.assertRaises(Exception, lldb.SBFile, "ham sandwich")
@@ -660,6 +699,7 @@ def test_exceptions(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_exceptions_logged(self):
         messages = list()
         self.dbg.SetLoggingCallback(messages.append)
@@ -671,6 +711,7 @@ def test_exceptions_logged(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_flush(self):
         flushed = MutableBool(False)
         closed = MutableBool(False)
@@ -700,6 +741,7 @@ def test_flush(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_fileno_flush(self):
         with open(self.out_filename, 'w') as f:
             f.write("foo")
@@ -721,6 +763,7 @@ def test_fileno_flush(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_close(self):
         with open(self.out_filename, 'w') as f:
             status = self.dbg.SetOutputFile(f)
@@ -740,6 +783,7 @@ def test_close(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_stdout(self):
         f = io.StringIO()
         status = self.dbg.SetOutputFile(f)
@@ -749,6 +793,7 @@ def test_stdout(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_stdout_file(self):
         with open(self.out_filename, 'w') as f:
             status = self.dbg.SetOutputFile(f)
@@ -765,6 +810,7 @@ def test_stdout_file(self):
 
     @add_test_categories(['pyapi'])
     @skipIf(py_version=['<', (3,)])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_identity(self):
 
         f = io.StringIO()
@@ -820,6 +866,7 @@ def test_identity(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_back_and_forth(self):
         with open(self.out_filename, 'w') as f:
             # at each step here we're borrowing the file, so we have to keep
@@ -839,6 +886,7 @@ def i(sbf):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_set_filehandle_none(self):
         self.assertRaises(Exception, self.dbg.SetOutputFile, None)
         self.assertRaises(Exception, self.dbg.SetOutputFile, "ham sandwich")
@@ -877,6 +925,7 @@ def test_set_filehandle_none(self):
 
 
     @add_test_categories(['pyapi'])
+    @@skipIfReproducer # lldb::FileSP used in typemap cannot be instrumented.
     def test_sbstream(self):
 
         with open(self.out_filename, 'w') as f:


        


More information about the lldb-commits mailing list