[Lldb-commits] [lldb] 08249d7 - [lldb] Fix TestAPILog.py for reproducer replay

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 21 10:35:43 PDT 2020


Author: Jonas Devlieghere
Date: 2020-08-21T10:35:35-07:00
New Revision: 08249d7f72ff8f8648c5264e090813c9c2cad466

URL: https://github.com/llvm/llvm-project/commit/08249d7f72ff8f8648c5264e090813c9c2cad466
DIFF: https://github.com/llvm/llvm-project/commit/08249d7f72ff8f8648c5264e090813c9c2cad466.diff

LOG: [lldb] Fix TestAPILog.py for reproducer replay

With the log file being a build artifact we don't need to clean it up.
If this happens before the reproducer is captured, the file will be
missing from the reproducer root but being part of the mapping.

Added: 
    

Modified: 
    lldb/test/API/api/log/TestAPILog.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/api/log/TestAPILog.py b/lldb/test/API/api/log/TestAPILog.py
index 72df276b06c3b..d5a2e4857e536 100644
--- a/lldb/test/API/api/log/TestAPILog.py
+++ b/lldb/test/API/api/log/TestAPILog.py
@@ -19,20 +19,15 @@ def test_api_log(self):
         """Test API logging"""
         logfile = self.getBuildArtifact("api-log.txt")
 
-        def cleanup():
-            if os.path.exists(logfile):
-                os.unlink(logfile)
-
-        if configuration.is_reproducer_replay():
-            logfile = self.getReproducerRemappedPath(logfile)
-
-        self.addTearDownHook(cleanup)
         self.expect("log enable lldb api -f {}".format(logfile))
 
         self.dbg.SetDefaultArchitecture(None)
         self.dbg.GetScriptingLanguage(None)
         target = self.dbg.CreateTarget(None)
 
+        if configuration.is_reproducer_replay():
+            logfile = self.getReproducerRemappedPath(logfile)
+
         self.assertTrue(os.path.isfile(logfile))
         with open(logfile, 'r') as f:
             log = f.read()


        


More information about the lldb-commits mailing list