988d90a7bb37f0e5d38cb2ac1c06830dd2531ed6
[openbsd] /
1 """
2 Test that step over will let other threads run when necessary
3 """
4
5 from __future__ import print_function
6
7
8 import lldb
9 from lldbsuite.test.decorators import *
10 from lldbsuite.test.lldbtest import *
11 from lldbsuite.test import lldbutil
12
13
14 class StepOverDoesntDeadlockTestCase(TestBase):
15
16     mydir = TestBase.compute_mydir(__file__)
17
18     def test_step_over(self):
19         """Test that when step over steps over a function it lets other threads run."""
20         self.build()
21         (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
22                                                                             "without running the first thread at least somewhat",
23                                                                             lldb.SBFileSpec("locking.cpp"))
24         # This is just testing that the step over actually completes.
25         # If the test fails this step never return, so failure is really
26         # signaled by the test timing out.
27         
28         thread.StepOver()
29         state = process.GetState()
30         self.assertEqual(state, lldb.eStateStopped)