[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.
This commit is contained in:
parent
50aae46331
commit
08249d7f72
|
|
@ -19,20 +19,15 @@ class APILogTestCase(TestBase):
|
||||||
"""Test API logging"""
|
"""Test API logging"""
|
||||||
logfile = self.getBuildArtifact("api-log.txt")
|
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.expect("log enable lldb api -f {}".format(logfile))
|
||||||
|
|
||||||
self.dbg.SetDefaultArchitecture(None)
|
self.dbg.SetDefaultArchitecture(None)
|
||||||
self.dbg.GetScriptingLanguage(None)
|
self.dbg.GetScriptingLanguage(None)
|
||||||
target = self.dbg.CreateTarget(None)
|
target = self.dbg.CreateTarget(None)
|
||||||
|
|
||||||
|
if configuration.is_reproducer_replay():
|
||||||
|
logfile = self.getReproducerRemappedPath(logfile)
|
||||||
|
|
||||||
self.assertTrue(os.path.isfile(logfile))
|
self.assertTrue(os.path.isfile(logfile))
|
||||||
with open(logfile, 'r') as f:
|
with open(logfile, 'r') as f:
|
||||||
log = f.read()
|
log = f.read()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue