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    def test_step_over(self):
17        """Test that when step over steps over a function it lets other threads run."""
18        self.build()
19        (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
20                                                                            "without running the first thread at least somewhat",
21                                                                            lldb.SBFileSpec("locking.cpp"))
22        # This is just testing that the step over actually completes.
23        # If the test fails this step never return, so failure is really
24        # signaled by the test timing out.
25
26        thread.StepOver()
27        state = process.GetState()
28        self.assertState(state, lldb.eStateStopped)
29