@@ -39,37 +39,16 @@ def execute_command(self, command):
39
39
40
40
def setUp (self ):
41
41
TestBase .setUp (self )
42
- self .PlaygroundStub_source = "PlaygroundStub.swift"
43
- self .PlaygroundStub_source_spec = lldb .SBFileSpec (
44
- self .PlaygroundStub_source )
45
42
46
43
def repl_set_up (self ):
47
44
"""
48
45
Playgrounds REPL test specific setup that must happen after class setup
49
46
"""
50
- exe_name = "PlaygroundStub"
51
- exe = self .getBuildArtifact (exe_name )
47
+ target , process , thread , bkpt = lldbutil .run_to_source_breakpoint (
48
+ self , 'Set breakpoint here' , lldb .SBFileSpec ('PlaygroundStub.swift' ),
49
+ exe_name = 'PlaygroundStub' , extra_images = ['libPlaygroundsRuntime.dylib' ])
52
50
53
- # Create the target
54
- target = self .dbg .CreateTarget (exe )
55
- self .assertTrue (target , VALID_TARGET )
56
-
57
- self .registerSharedLibrariesWithTarget (target , ['libPlaygroundsRuntime.dylib' ])
58
-
59
- # Set the breakpoints
60
- breakpoint = target .BreakpointCreateBySourceRegex (
61
- 'Set breakpoint here' , self .PlaygroundStub_source_spec )
62
- self .assertTrue (breakpoint .GetNumLocations () > 0 , VALID_BREAKPOINT )
63
-
64
- process = target .LaunchSimple (None , None , self .getBuildDir ())
65
- self .assertTrue (process , PROCESS_IS_VALID )
66
-
67
- threads = lldbutil .get_threads_stopped_at_breakpoint (
68
- process , breakpoint )
69
-
70
- self .assertTrue (len (threads ) == 1 )
71
- self .thread = threads [0 ]
72
- self .frame = self .thread .frames [0 ]
51
+ self .frame = thread .frames [0 ]
73
52
self .assertTrue (self .frame , "Frame 0 is valid." )
74
53
75
54
# Configure lldb
@@ -100,9 +79,10 @@ def execute_code(self, inputFile):
100
79
contents = contents_file .read ()
101
80
102
81
result = self .frame .EvaluateExpression (contents , self .options )
103
- ouput = self .frame .EvaluateExpression ("get_output()" )
82
+ output = self .frame .EvaluateExpression ("get_output()" )
83
+ self .assertSuccess (output .GetError ())
104
84
105
- return result , ouput
85
+ return result , output
106
86
107
87
def is_compile_or_runtime_error (self , result ):
108
88
"""
0 commit comments