mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 15:14:31 +00:00
[lldb] Assert the process has exited before we gets its output.
This commit is contained in:
1 parent
7abef41674
commit
a97dfdc30b
1 file changed
+7
@@ -162,9 +162,14 @@ class TargetAPITestCase(TestBase):
|
||||
self.setTearDownCleanup(dictionary=d)
|
||||
target = self.create_simple_target('b.out')
|
||||
|
||||
# Set the debugger to synchronous mode so we only continue after the
|
||||
# process has exited.
|
||||
self.dbg.SetAsync(False)
|
||||
|
||||
process = target.LaunchSimple(
|
||||
['foo', 'bar'], ['baz'], self.get_process_working_directory())
|
||||
self.runCmd("run")
|
||||
self.assertEqual(process.GetState(), lldb.eStateExited)
|
||||
output = process.GetSTDOUT(9999)
|
||||
self.assertIn('arg: foo', output)
|
||||
self.assertIn('arg: bar', output)
|
||||
@@ -175,6 +180,7 @@ class TargetAPITestCase(TestBase):
|
||||
process = target.LaunchSimple(None, None,
|
||||
self.get_process_working_directory())
|
||||
self.runCmd("run")
|
||||
self.assertEqual(process.GetState(), lldb.eStateExited)
|
||||
output = process.GetSTDOUT(9999)
|
||||
self.assertIn('arg: foo', output)
|
||||
self.assertIn('env: bar=baz', output)
|
||||
@@ -183,6 +189,7 @@ class TargetAPITestCase(TestBase):
|
||||
process = target.LaunchSimple(
|
||||
None, None, self.get_process_working_directory())
|
||||
self.runCmd("run")
|
||||
self.assertEqual(process.GetState(), lldb.eStateExited)
|
||||
output = process.GetSTDOUT(9999)
|
||||
self.assertEqual(output, "")
|
||||
|
||||
|
||||
Reference in new issue
Block a user