Skip to content

Commit

Permalink
[lldb] Fix TestAPILog.py for reproducer replay
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JDevlieghere committed Aug 21, 2020
1 parent 50aae46 commit 08249d7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lldb/test/API/api/log/TestAPILog.py
Expand Up @@ -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()
Expand Down

0 comments on commit 08249d7

Please sign in to comment.