This is an archive of the discontinued LLVM Phabricator instance.

[lldb][test] Replace use of p with expression (NFC)
ClosedPublic

Authored by kastiglione on Jan 11 2023, 12:13 PM.

Details

Summary

In API tests, replace use of the p alias with the expression command.

To avoid conflating tests of the alias with tests of the expression command,
this patch canonicalizes to the use expression.

Diff Detail

Event Timeline

kastiglione created this revision.Jan 11 2023, 12:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 12:13 PM
kastiglione requested review of this revision.Jan 11 2023, 12:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 12:13 PM
aprantl accepted this revision.Jan 11 2023, 2:22 PM

I think it makes sense to have one test that tests the p command alias and its parameter handling and have all other tests be explicit about whether they test the expression evaluator or the command alias. As such, this is a good canonicalization.

lldb/test/API/python_api/file_handle/TestFileHandle.py
138

not your code, but does the /x serve any purpose here?

This revision is now accepted and ready to land.Jan 11 2023, 2:22 PM

I will add explicit tests for p.

lldb/test/API/python_api/file_handle/TestFileHandle.py
138

a couple lines below they read in the output from this command, and compare hex 3735928559 to "deadbeef".

kastiglione added inline comments.Jan 11 2023, 2:52 PM
lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py
74

@aprantl I don't see why these /d are not needed though.

aprantl added inline comments.Jan 20 2023, 11:07 AM
lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py
74

Oh otherwise they'd be printed in hex. Makes sense.

Add a test for p; Replace few instances of print with expression too.

This revision was automatically updated to reflect the committed changes.