Skip to content

Commit 538cb04

Browse files
committed
[lldb] Convert more tests to use expression directly (NFC)
1 parent 4473833 commit 538cb04

File tree

20 files changed

+35
-35
lines changed

20 files changed

+35
-35
lines changed

lldb/test/API/lang/swift/clangimporter/Werror/TestSwiftStripWerror.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test(self):
2828
log = self.getBuildArtifact("types.log")
2929
self.expect("log enable lldb types -f "+log)
3030

31-
self.expect("p foo", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["42"])
31+
self.expect("expression foo", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["42"])
3232
sanity = 0
3333
import io
3434
logfile = io.open(log, "r", encoding='utf-8')

lldb/test/API/lang/swift/clangimporter/config_macros/TestSwiftDedupMacros.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def testSwiftDebugMacros(self):
4949
log = self.getBuildArtifact("types.log")
5050
self.expect("log enable lldb types -f "+log)
5151

52-
self.expect("p foo", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["42"])
52+
self.expect("expression foo", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["42"])
5353
debug = 0
5454
space = 0
5555
ndebug = 0

lldb/test/API/lang/swift/clangimporter/objcmain_conflicting_dylibs/TestSwiftObjCMainConflictingDylibs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ def test(self):
5353
process = target.LaunchSimple(None, None, os.getcwd())
5454
# This is failing because the Target-SwiftASTContext uses the
5555
# amalgamated target header search options from all dylibs.
56-
self.expect("p baz", "wrong baz", substrs=["i_am_from_Foo"])
56+
self.expect("expression baz", "wrong baz", substrs=["i_am_from_Foo"])
5757
self.expect("fr var baz", "wrong baz", substrs=["i_am_from_Foo"])
5858

5959

6060
process.Continue()
61-
self.expect("p baz", "correct baz", substrs=["i_am_from_Foo"])
61+
self.expect("expression baz", "correct baz", substrs=["i_am_from_Foo"])
6262
self.expect("fr var baz", "correct baz", substrs=["i_am_from_Foo"])
6363

lldb/test/API/lang/swift/clangimporter/objcmain_conflicting_dylibs_failing_import/TestSwiftObjCMainConflictingDylibsFailingImport.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def test(self):
5252

5353
# This initially fails with the shared scratch context and is
5454
# then retried with the per-dylib scratch context.
55-
# self.expect("p bar", "expected result", substrs=["$R0", "42"])
56-
# self.expect("p $R0", "expected result", substrs=["$R1", "42"])
57-
# self.expect("p $R1", "expected result", substrs=["$R2", "42"])
55+
# self.expect("expression bar", "expected result", substrs=["$R0", "42"])
56+
# self.expect("expression $R0", "expected result", substrs=["$R1", "42"])
57+
# self.expect("expression $R1", "expected result", substrs=["$R2", "42"])
5858

5959
# This works by accident because the search paths are in the right order.
6060
foo_breakpoint = target.BreakpointCreateBySourceRegex(
@@ -64,7 +64,7 @@ def test(self):
6464
# FIXME: The following expression evaluator tests are disabled
6565
# because it's nondeterministic which one will work.
6666

67-
# self.expect("p foo", "expected result", substrs=["$R3", "23"])
68-
# self.expect("p $R3", "expected result", substrs=["23"])
69-
# self.expect("p $R4", "expected result", substrs=["23"])
67+
# self.expect("expression foo", "expected result", substrs=["$R3", "23"])
68+
# self.expect("expression $R3", "expected result", substrs=["23"])
69+
# self.expect("expression $R4", "expected result", substrs=["23"])
7070

lldb/test/API/lang/swift/clangimporter/remap_sdk_path/TestSwiftRemapSDKPath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test(self):
2222
self.runCmd('log enable lldb types -f "%s"' % log)
2323
target, process, thread, bkpt = lldbutil.run_to_name_breakpoint(
2424
self, 'main')
25-
self.expect("p 1", substrs=["1"])
25+
self.expect("expression 1", substrs=["1"])
2626

2727
# Scan through the types log.
2828
import io

lldb/test/API/lang/swift/clangimporter/static_archive/TestSwiftStaticArchiveTwoSwiftmodules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test(self):
5252
# This test tests that the search paths from all swiftmodules
5353
# that are part of the main binary are honored.
5454
self.expect("fr var foo", "expected result", substrs=["23"])
55-
self.expect("p foo", "expected result", substrs=["$R0", "i", "23"])
55+
self.expect("expression foo", "expected result", substrs=["$R0", "i", "23"])
5656
process.Continue()
5757
self.expect("fr var bar", "expected result", substrs=["42"])
58-
self.expect("p bar", "expected result", substrs=["j", "42"])
58+
self.expect("expression bar", "expected result", substrs=["j", "42"])

lldb/test/API/lang/swift/class_empty/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Empty : CustomStringConvertible {
1717

1818
func main() {
1919
var e = Empty()
20-
print(e) //% self.expect("p 1", substrs=['1'])
20+
print(e) //% self.expect("expression 1", substrs=['1'])
2121
}
2222

2323
main()

lldb/test/API/lang/swift/closure_shortcuts/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ func main() -> Int {
1515
let names = ["foo", "patatino"]
1616

1717
var reversedNames = names.sorted(by: {
18-
$0 > $1 } //%self.expect('p $0', substrs=['patatino'])
19-
//%self.expect('p $1', substrs=['foo'])
18+
$0 > $1 } //%self.expect('expr $0', substrs=['patatino'])
19+
//%self.expect('expr $1', substrs=['foo'])
2020
//%self.expect('frame var $0', substrs=['patatino'])
2121
//%self.expect('frame var $1', substrs=['foo'])
2222
)

lldb/test/API/lang/swift/deployment_target/TestSwiftDeploymentTarget.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_swift_deployment_target(self):
3434
lldbutil.run_to_source_breakpoint(self,
3535
"break here",
3636
lldb.SBFileSpec('main.swift'))
37-
self.expect("p f", substrs=['i = 23'])
37+
self.expect("expression f", substrs=['i = 23'])
3838

3939
@skipUnlessDarwin
4040
@skipIfDarwinEmbedded # This test uses macOS triples explicitly.
@@ -47,7 +47,7 @@ def test_swift_deployment_target_dlopen(self):
4747
bkpt = target.BreakpointCreateBySourceRegex(
4848
'break here', lldb.SBFileSpec('NewerTarget.swift'))
4949
lldbutil.continue_to_breakpoint(process, bkpt)
50-
self.expect("p self", substrs=['i = 23'])
50+
self.expect("expression self", substrs=['i = 23'])
5151

5252
@skipUnlessDarwin
5353
@skipIfDarwinEmbedded # This test uses macOS triples explicitly.
@@ -61,7 +61,7 @@ def test_swift_deployment_target_from_macho(self):
6161
lldbutil.run_to_source_breakpoint(self,
6262
"break here",
6363
lldb.SBFileSpec('main.swift'))
64-
self.expect("p f", substrs=['i = 23'])
64+
self.expect("expression f", substrs=['i = 23'])
6565

6666
found_no_ast = False
6767
found_triple = False

lldb/test/API/lang/swift/expression/allocator/TestSwiftExprAllocator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ def test_allocator_self(self):
1919
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
2020
self, 'break here', lldb.SBFileSpec('main.swift'))
2121

22-
self.expect("p x", substrs=['23'])
22+
self.expect("expression x", substrs=['23'])

lldb/test/API/lang/swift/macCatalyst/TestSwiftMacCatalyst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_macCatalyst(self):
3636
self.expect("fr v s", "Hello macCatalyst")
3737
expr_log = self.getBuildArtifact("expr.log")
3838
self.expect('log enable lldb expr -f "%s"' % expr_log)
39-
self.expect("p s", "Hello macCatalyst")
39+
self.expect("expression s", "Hello macCatalyst")
4040
import io
4141
expr_logfile = io.open(expr_log, "r", encoding='utf-8')
4242

lldb/test/API/lang/swift/missing_sdk/TestMissingSDK.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ def testMissingSDK(self):
2626
os.unlink(self.getBuildArtifact("fakesdk"))
2727
lldbutil.run_to_source_breakpoint(self, 'break here',
2828
lldb.SBFileSpec('main.swift'))
29-
self.expect("p message", VARIABLES_DISPLAYED_CORRECTLY,
29+
self.expect("expression message", VARIABLES_DISPLAYED_CORRECTLY,
3030
substrs = ["Hello"])
3131

lldb/test/API/lang/swift/protocol_extension_computed_property/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ extension Measurement where UnitType == UnitAngle {
1313
}
1414

1515
func f() {
16-
return //%self.expect('p self.radians', substrs=["CGFloat) $R0", "= 1.745"])
17-
//%self.expect('p self', substrs=["Measurement<UnitAngle>"])
16+
return //%self.expect('expression self.radians', substrs=["CGFloat) $R0", "= 1.745"])
17+
//%self.expect('expression self', substrs=["Measurement<UnitAngle>"])
1818
}
1919
}
2020

lldb/test/API/lang/swift/protocol_extension_two/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ extension Patatino where T == Winky {
1010
}
1111

1212
func f() {
13-
return //%self.expect('p self.baciotto', substrs=["(Int) $R0 = 0"])
14-
//%self.expect('p self', substrs=["a.Patatino<a.Winky>"])
13+
return //%self.expect('expression self.baciotto', substrs=["(Int) $R0 = 0"])
14+
//%self.expect('expression self', substrs=["a.Patatino<a.Winky>"])
1515
}
1616
}
1717

lldb/test/API/lang/swift/runtime_library_path/TestSwiftRuntimeLibraryPath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test(self):
2525
target, process, thread, bkpt = lldbutil.run_to_name_breakpoint(
2626
self, 'main')
2727

28-
self.expect("p 1")
28+
self.expect("expression 1")
2929
import io
3030
logfile = io.open(log, "r", encoding='utf-8')
3131
in_expr_log = 0

lldb/test/API/lang/swift/swift-healthcheck/TestSwiftHealthCheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_run_healthcheck(self):
1919

2020
target, process, thread, bkpt = lldbutil.run_to_name_breakpoint(
2121
self, 'main')
22-
self.expect("p 1")
22+
self.expect("expression 1")
2323
result = lldb.SBCommandReturnObject()
2424
ret_val = self.dbg.GetCommandInterpreter().HandleCommand("swift-healthcheck", result)
2525
log = result.GetOutput()[:-1].split(" ")[-1]

lldb/test/API/lang/swift/tripleDetection/TestSwiftTripleDetection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test(self):
2626
arch+"-apple-macos-unknown")
2727
bkpt = target.BreakpointCreateByName("main")
2828
process = target.LaunchSimple(None, None, self.get_process_working_directory())
29-
self.expect("p 1")
29+
self.expect("expression 1")
3030
import io
3131
types_logfile = io.open(types_log, "r", encoding='utf-8')
3232

lldb/test/API/lang/swift/variables/swift/TestSwiftTypes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ def do_test(self):
177177

178178
self.expect("frame variable --raw hello", substrs=['String'])
179179

180-
self.expect("p/x int64_minus_two", substrs=['0xfffffffffffffffe'])
181-
self.expect("p/u ~1", substrs=['18446744073709551614'])
182-
self.expect("p/d ~1", substrs=['-2'])
180+
self.expect("expression/x int64_minus_two", substrs=['0xfffffffffffffffe'])
181+
self.expect("expression/u ~1", substrs=['18446744073709551614'])
182+
self.expect("expression/d ~1", substrs=['-2'])
183183

184184
self.expect('frame variable uint8_max', substrs=['-1'], matching=False)
185185
self.expect(

lldb/test/API/lang/swift/xcode_sdk/TestSwiftXcodeSDK.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_decode(self):
3535

3636
lldbutil.run_to_name_breakpoint(self, 'main')
3737

38-
self.expect("p 1")
38+
self.expect("expression 1")
3939
self.check_log(log, "MacOSX")
4040

4141
@swiftTest

lldb/test/API/linux/aarch64/non_address_bit_memory_access/TestAArch64LinuxNonAddressBitMemoryAccess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ def test_non_address_bit_memory_caching(self):
153153

154154
# This should fill the cache by doing a read of buf_with_non_address
155155
# with the non-address bits removed (which is == buf).
156-
self.runCmd("p buf_with_non_address")
156+
self.runCmd("expression buf_with_non_address")
157157
# This will read from the cache since the two pointers point to the
158158
# same place.
159-
self.runCmd("p buf")
159+
self.runCmd("expression buf")
160160

161161
# Open log ignoring utf-8 decode errors
162162
with open(log_file, 'r', errors='ignore') as f:

0 commit comments

Comments
 (0)