1"""
2Test that step over will let other threads run when necessary
3"""
4
5from __future__ import print_function
6
7
8import lldb
9from lldbsuite.test.decorators import *
10from lldbsuite.test.lldbtest import *
11from lldbsuite.test import lldbutil
12
13
14class 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)
31