This is an archive of the discontinued LLVM Phabricator instance.

[lldb/test] Allow indentation in inline tests
ClosedPublic

Authored by labath on Oct 28 2021, 5:00 AM.

Details

Summary

This makes it possible to use for loops (and other language constructs)
in inline tests.

Diff Detail

Event Timeline

labath requested review of this revision.Oct 28 2021, 5:00 AM
labath created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2021, 5:00 AM
teemperor accepted this revision.Oct 28 2021, 5:06 AM

LGTM, thanks.

On a more general note: I wish we would just kill off inline tests instead of trying to make them usable. But I think that's a discussion for the mailing lists...

lldb/test/API/test_utils/TestInlineTest.py
11

nit: maybe give this a more unique name + a doc string.

11

Also I think this should be a NO_DEBUG_INFO_TESTCASE ?

This revision is now accepted and ready to land.Oct 28 2021, 5:06 AM
labath marked 2 inline comments as done.Oct 28 2021, 5:18 AM
labath added inline comments.
lldb/test/API/test_utils/TestInlineTest.py
11

Fun fact: tests which inherit from Base (instead of TestBase) don't automatically get debug info multiplication. (They also don't get a lot of other things, which is why this isn't suitable for regular tests, but this isn't a regular test.)

labath marked an inline comment as done.Oct 28 2021, 5:32 AM

On a more general note: I wish we would just kill off inline tests instead of trying to make them usable. But I think that's a discussion for the mailing lists...

I actually kinda like the inline tests, as they allow you to put the source code and the test expectations into the same file (which makes them very similar to llvm tests). But they do leave a lot to be desired...

This revision was automatically updated to reflect the committed changes.
shafik added a subscriber: shafik.Oct 28 2021, 8:21 PM

I agree, we should be trying to get ride of inline tests. The last time I had to debug one it was not a fun experience. Maybe some of the recent improvements have helped there though.