Skip to content

Commit 50b1dc7

Browse files
committed
[lldb] Gardening: When testing use self.process.Continue() instead of handrolling continue via a run cmd.
1 parent 5391bc6 commit 50b1dc7

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

lldb/test/API/lang/swift/variables/move_function/TestSwiftMoveFunction.py

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -134,37 +134,37 @@ def do_check_copyable_value_test(self):
134134
self.assertIsNone(varK.value, "varK initialized too early?!")
135135

136136
# Go to break point 2. k should be valid.
137-
self.runCmd('continue')
137+
self.process.Continue()
138138
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
139139

140140
# Go to breakpoint 3. k should no longer be valid.
141-
self.runCmd('continue')
141+
self.process.Continue()
142142
self.assertIsNone(varK.value, "K is live but was moved?!")
143143

144144
# Run so we hit the next breakpoint to jump to the next test's
145145
# breakpoint.
146-
self.runCmd('continue')
146+
self.process.Continue()
147147

148148
def do_check_copyable_var_test(self):
149149
# We haven't defined varK yet.
150150
varK = self.get_var('k')
151151
self.assertIsNone(varK.value, "varK initialized too early?!")
152152

153153
# Go to break point 2. k should be valid.
154-
self.runCmd('continue')
154+
self.process.Continue()
155155
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
156156

157157
# Go to breakpoint 3. We invalidated k
158-
self.runCmd('continue')
158+
self.process.Continue()
159159
self.assertIsNone(varK.value, "K is live but was moved?!")
160160

161161
# Go to the last breakpoint and make sure that k is reinitialized
162162
# properly.
163-
self.runCmd('continue')
163+
self.process.Continue()
164164
self.assertGreater(varK.unsigned, 0, "varK not initialized")
165165

166166
# Run so we hit the next breakpoint to go to the next test.
167-
self.runCmd('continue')
167+
self.process.Continue()
168168

169169
def do_check_addressonly_value_test(self):
170170
# We haven't defined varK yet.
@@ -175,73 +175,73 @@ def do_check_addressonly_value_test(self):
175175
# so we don't do so. We have an additional llvm.dbg.addr test where we
176176
# move the other variable and show the correct behavior with
177177
# llvm.dbg.declare.
178-
self.runCmd('continue')
178+
self.process.Continue()
179179
self.assertGreater(varK.unsigned, 0, "var not initialized?!")
180180

181181
# Go to breakpoint 3.
182-
self.runCmd('continue')
182+
self.process.Continue()
183183
self.assertEqual(varK.unsigned, 0,
184184
"dbg thinks varK is live despite move?!")
185185

186186
# Run so we hit the next breakpoint as part of the next test.
187-
self.runCmd('continue')
187+
self.process.Continue()
188188

189189
def do_check_addressonly_var_test(self):
190190
varK = self.get_var('k')
191191

192192
# Go to break point 2. k should be valid.
193-
self.runCmd('continue')
193+
self.process.Continue()
194194
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
195195

196196
# Go to breakpoint 3. K was invalidated.
197-
self.runCmd('continue')
197+
self.process.Continue()
198198
self.assertIsNone(varK.value, "K is live but was moved?!")
199199

200200
# Go to the last breakpoint and make sure that k is reinitialized
201201
# properly.
202-
self.runCmd('continue')
202+
self.process.Continue()
203203
self.assertGreater(varK.unsigned, 0, "varK not initialized")
204204

205205
# Run so we hit the next breakpoint as part of the next test.
206-
self.runCmd('continue')
206+
self.process.Continue()
207207

208208
def do_check_copyable_value_arg_test(self):
209209
# k is defined by the argument so it is valid.
210210
varK = self.get_var('k')
211211
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
212212

213213
# Go to break point 2. k should be valid.
214-
self.runCmd('continue')
214+
self.process.Continue()
215215
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
216216

217217
# Go to breakpoint 3. k should no longer be valid.
218-
self.runCmd('continue')
218+
self.process.Continue()
219219
#self.assertIsNone(varK.value, "K is live but was moved?!")
220220

221221
# Run so we hit the next breakpoint to jump to the next test's
222222
# breakpoint.
223-
self.runCmd('continue')
223+
self.process.Continue()
224224

225225
def do_check_copyable_var_arg_test(self):
226226
# k is already defined and is an argument.
227227
varK = self.get_var('k')
228228
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
229229

230230
# Go to break point 2. k should be valid.
231-
self.runCmd('continue')
231+
self.process.Continue()
232232
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
233233

234234
# Go to breakpoint 3. We invalidated k
235-
self.runCmd('continue')
235+
self.process.Continue()
236236
self.assertIsNone(varK.value, "K is live but was moved?!")
237237

238238
# Go to the last breakpoint and make sure that k is reinitialized
239239
# properly.
240-
self.runCmd('continue')
240+
self.process.Continue()
241241
self.assertGreater(varK.unsigned, 0, "varK not initialized")
242242

243243
# Run so we hit the next breakpoint to go to the next test.
244-
self.runCmd('continue')
244+
self.process.Continue()
245245

246246
def do_check_addressonly_value_arg_test(self):
247247
# k is defined since it is an argument.
@@ -253,81 +253,81 @@ def do_check_addressonly_value_arg_test(self):
253253
# so we don't do so. We have an additional llvm.dbg.addr test where we
254254
# move the other variable and show the correct behavior with
255255
# llvm.dbg.declare.
256-
self.runCmd('continue')
256+
self.process.Continue()
257257
self.assertGreater(varK.unsigned, 0, "var not initialized?!")
258258

259259
# Go to breakpoint 3.
260-
self.runCmd('continue')
260+
self.process.Continue()
261261
self.assertEqual(varK.unsigned, 0,
262262
"dbg thinks varK is live despite move?!")
263263

264264
# Run so we hit the next breakpoint as part of the next test.
265-
self.runCmd('continue')
265+
self.process.Continue()
266266

267267
def do_check_addressonly_var_arg_test(self):
268268
varK = self.get_var('k')
269269
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
270270

271271
# Go to break point 2. k should be valid.
272-
self.runCmd('continue')
272+
self.process.Continue()
273273
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
274274

275275
# Go to breakpoint 3. K was invalidated.
276-
self.runCmd('continue')
276+
self.process.Continue()
277277
self.assertIsNone(varK.value, "K is live but was moved?!")
278278

279279
# Go to the last breakpoint and make sure that k is reinitialized
280280
# properly.
281-
self.runCmd('continue')
281+
self.process.Continue()
282282
# There is some sort of bug here. We should have the value here. For now
283283
# leave the next line commented out and validate we are not seeing the
284284
# value so we can detect change in behavior.
285285
self.assertGreater(varK.unsigned, 0, "varK not initialized")
286286

287287
# Run so we hit the next breakpoint as part of the next test.
288-
self.runCmd('continue')
288+
self.process.Continue()
289289

290290
def do_check_copyable_value_ccf_true(self):
291291
varK = self.get_var('k')
292292

293293
# Check at our start point that we do not have any state for varK and
294294
# then continue to our next breakpoint.
295295
self.assertIsNone(varK.value, "varK should not have a value?!")
296-
self.runCmd('continue')
296+
self.process.Continue()
297297

298298
# At this breakpoint, k should be defined since we are going to do
299299
# something with it.
300300
self.assertIsNotNone(varK.value, "varK should have a value?!")
301-
self.runCmd('continue')
301+
self.process.Continue()
302302

303303
# At this breakpoint, we are now in the conditional control flow part of
304304
# the loop. Make sure that we can see k still.
305305
self.assertIsNotNone(varK.value, "varK should have a value?!")
306-
self.runCmd('continue')
306+
self.process.Continue()
307307

308308
# Ok, we just performed the move. k should not be no longer initialized.
309309
self.assertIsNone(varK.value, "varK should not have a value?!")
310-
self.runCmd('continue')
310+
self.process.Continue()
311311

312312
# Finally we left the conditional control flow part of the function. k
313313
# should still be None.
314314
self.assertIsNone(varK.value, "varK should not have a value!")
315315

316316
# Run again so we go and run to the next test.
317-
self.runCmd('continue')
317+
self.process.Continue()
318318

319319
def do_check_copyable_value_ccf_false(self):
320320
varK = self.get_var('k')
321321

322322
# Check at our start point that we do not have any state for varK and
323323
# then continue to our next breakpoint.
324324
self.assertIsNone(varK.value, "varK should not have a value?!")
325-
self.runCmd('continue')
325+
self.process.Continue()
326326

327327
# At this breakpoint, k should be defined since we are going to do
328328
# something with it.
329329
self.assertIsNotNone(varK.value, "varK should have a value?!")
330-
self.runCmd('continue')
330+
self.process.Continue()
331331

332332
# At this breakpoint, we are now past the end of the conditional
333333
# statement. We know due to the move checking that k can not have any
@@ -336,110 +336,110 @@ def do_check_copyable_value_ccf_false(self):
336336
self.assertIsNone(varK.value, "varK should have a value?!")
337337

338338
# Run again so we go and run to the next test.
339-
self.runCmd('continue')
339+
self.process.Continue()
340340

341341
def do_check_copyable_var_ccf_true_reinit_out_block(self):
342342
varK = self.get_var('k')
343343

344344
# At first we should not have a value for k.
345345
self.assertEqual(varK.unsigned, 0, "varK should be nullptr!")
346-
self.runCmd('continue')
346+
self.process.Continue()
347347

348348
# Now we are in the conditional true block. K should be defined since we
349349
# are on the move itself.
350350
self.assertGreater(varK.unsigned, 0, "varK should not be nullptr!")
351-
self.runCmd('continue')
351+
self.process.Continue()
352352

353353
# Now we have executed the move and we are about to run code using
354354
# m. Make sure that K is not available!
355355
self.assertEqual(varK.unsigned, 0,
356356
"varK was already moved! Should be nullptr")
357-
self.runCmd('continue')
357+
self.process.Continue()
358358

359359
# We are now out of the conditional lexical block on the line of code
360360
# that redefines k. k should still be not available.
361361
self.assertEqual(varK.unsigned, 0,
362362
"varK was already moved! Should be nullptr")
363-
self.runCmd('continue')
363+
self.process.Continue()
364364

365365
# Ok, we have now reinit k and are about to call a method on it. We
366366
# should be valid now.
367367
self.assertGreater(varK.unsigned, 0,
368368
"varK should have be reinitialized?!")
369369

370370
# Run again so we go and run to the next test.
371-
self.runCmd('continue')
371+
self.process.Continue()
372372

373373
def do_check_copyable_var_ccf_true_reinit_in_block(self):
374374
varK = self.get_var('k')
375375

376376
# At first we should not have a value for k.
377377
self.assertEqual(varK.unsigned, 0, "varK should be nullptr!")
378-
self.runCmd('continue')
378+
self.process.Continue()
379379

380380
# Now we are in the conditional true block. K should be defined since we
381381
# are on the move itself.
382382
self.assertGreater(varK.unsigned, 0, "varK should not be nullptr!")
383-
self.runCmd('continue')
383+
self.process.Continue()
384384

385385
# Now we have executed the move and we are about to reinit k but have
386386
# not yet. Make sure we are not available!
387387
self.assertEqual(varK.unsigned, 0,
388388
"varK was already moved! Should be nullptr")
389-
self.runCmd('continue')
389+
self.process.Continue()
390390

391391
# We are now still inside the conditional part of the code, but have
392392
# reinitialized varK.
393393
self.assertGreater(varK.unsigned, 0,
394394
"varK was reinit! Should be valid value!")
395-
self.runCmd('continue')
395+
self.process.Continue()
396396

397397
# We now have left the conditional part of the function. k should still
398398
# be available.
399399
self.assertGreater(varK.unsigned, 0,
400400
"varK should have be reinitialized?!")
401401

402402
# Run again so we go and run to the next test.
403-
self.runCmd('continue')
403+
self.process.Continue()
404404

405405
def do_check_copyable_var_ccf_false_reinit_out_block(self):
406406
varK = self.get_var('k')
407407

408408
# At first we should not have a value for k.
409409
self.assertEqual(varK.unsigned, 0, "varK should be nullptr!")
410-
self.runCmd('continue')
410+
self.process.Continue()
411411

412412
# Now we are right above the beginning of the false check. varK should
413413
# still be valid.
414414
self.assertGreater(varK.unsigned, 0, "varK should not be nullptr!")
415-
self.runCmd('continue')
415+
self.process.Continue()
416416

417417
# Now we are after the conditional part of the code on the reinit
418418
# line. Since this is reachable from the move and we haven't reinit yet,
419419
# k should not be available.
420420
self.assertEqual(varK.unsigned, 0,
421421
"varK was already moved! Should be nullptr")
422-
self.runCmd('continue')
422+
self.process.Continue()
423423

424424
# Ok, we have now reinit k and are about to call a method on it. We
425425
# should be valid now.
426426
self.assertGreater(varK.unsigned, 0,
427427
"varK should have be reinitialized?!")
428428

429429
# Run again so we go and run to the next test.
430-
self.runCmd('continue')
430+
self.process.Continue()
431431

432432
def do_check_copyable_var_ccf_false_reinit_in_block(self):
433433
varK = self.get_var('k')
434434

435435
# At first we should not have a value for k.
436436
self.assertEqual(varK.unsigned, 0, "varK should be nullptr!")
437-
self.runCmd('continue')
437+
self.process.Continue()
438438

439439
# Now we are on the doSomething above the false check. So varK should be
440440
# valid.
441441
self.assertGreater(varK.unsigned, 0, "varK should not be nullptr!")
442-
self.runCmd('continue')
442+
self.process.Continue()
443443

444444
# Now we are after the conditional scope. Since k was reinitialized in
445445
# the conditional scope, along all paths we are valid so varK should
@@ -448,4 +448,4 @@ def do_check_copyable_var_ccf_false_reinit_in_block(self):
448448
"varK should not be nullptr?!")
449449

450450
# Run again so we go and run to the next test.
451-
self.runCmd('continue')
451+
self.process.Continue()

0 commit comments

Comments
 (0)