Modernize a test.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@327924 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py b/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
index c7368a4..92b58ce 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
@@ -48,35 +48,8 @@
# Get main source file
src_file = "main.cpp"
src_file_spec = lldb.SBFileSpec(src_file)
- self.assertTrue(src_file_spec.IsValid(), "Main source file")
- # Get the path of the executable
- exe_path = self.getBuildArtifact(exe)
-
- # Load the executable
- target = self.dbg.CreateTarget(exe_path)
- self.assertTrue(target.IsValid(), VALID_TARGET)
-
- # Break on main function
- main_breakpoint = target.BreakpointCreateBySourceRegex(
- "break here", src_file_spec)
- self.assertTrue(
- main_breakpoint.IsValid() and main_breakpoint.GetNumLocations() >= 1,
- VALID_BREAKPOINT)
-
- # Launch the process
- args = None
- env = None
- process = target.LaunchSimple(
- args, env, self.get_process_working_directory())
- self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
-
- # Get the thread of the process
- self.assertTrue(
- process.GetState() == lldb.eStateStopped,
- PROCESS_STOPPED)
- thread = lldbutil.get_stopped_thread(
- process, lldb.eStopReasonBreakpoint)
-
+ (target, process, thread, main_breakpoint) = lldbutil.run_to_source_breakpoint(self,
+ "break here", src_file_spec, exe_name = exe)
# Get frame for current thread
return thread.GetSelectedFrame()