diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2020-08-07 15:06:14 -0700 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2020-08-07 15:06:38 -0700 |
| commit | a97dfdc30b5bdec7d6cdcb9f421ef5a288495420 (patch) | |
| tree | 27f16cf7b4413dca6d2fdf5dde601882160299f1 /lldb/test/API/python_api | |
| parent | 7abef41674249cbc2e23a800762dc8f98013de66 (diff) | |
| download | llvm-a97dfdc30b5bdec7d6cdcb9f421ef5a288495420.zip llvm-a97dfdc30b5bdec7d6cdcb9f421ef5a288495420.tar.gz llvm-a97dfdc30b5bdec7d6cdcb9f421ef5a288495420.tar.bz2 | |
[lldb] Assert the process has exited before we gets its output.
Diffstat (limited to 'lldb/test/API/python_api')
| -rw-r--r-- | lldb/test/API/python_api/target/TestTargetAPI.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/target/TestTargetAPI.py b/lldb/test/API/python_api/target/TestTargetAPI.py index b97ae81..de8bed0 100644 --- a/lldb/test/API/python_api/target/TestTargetAPI.py +++ b/lldb/test/API/python_api/target/TestTargetAPI.py @@ -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, "") |
