This is an archive of the discontinued LLVM Phabricator instance.

[lldb/test] Make category-skipping logic "platform"-independent
ClosedPublic

Authored by labath on Mar 14 2022, 8:50 AM.

Details

Summary

The decision which categories are relevant for a particular test run
happen very early in the test setup process. They use the SBPlatform
object to determine which categories should be skipped. The platform
object created for this purpose transcends individual test runs.

This setup is not compatible with the direction discussed in
https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594

  • when platform objects are tied to a specific (SB)Debugger, they need

to be created alongside it, which currently happens in the test setUp
method.

This patch is the first step in that direction -- it rewrites the
category skipping logic to avoid depending on a global SBPlatform
object. Fortunately, the skipping logic is fairly simple (and I believe
it outght to stay that way) and mainly consists of comparing the
platform name against some hardcoded lists. This patch bases this
comparison on the platform name instead of the os part of the triple (as
reported by the platform).

Diff Detail

Event Timeline

labath created this revision.Mar 14 2022, 8:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2022, 8:50 AM
labath requested review of this revision.Mar 14 2022, 8:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2022, 8:50 AM
labath added inline comments.Mar 14 2022, 9:09 AM
lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
125

I'm not sure if this will work for all apple platforms. Can I assume all of them have configuration.apple_sdk set?

JDevlieghere accepted this revision.Mar 14 2022, 1:46 PM

LGTM

lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
125

Only for our "on-device" test suite (i.e. embedded platforms). Seems like the host case is handled below so that should be fine.

This revision is now accepted and ready to land.Mar 14 2022, 1:46 PM
shafik added a subscriber: shafik.Mar 15 2022, 8:17 AM

I think this PR broke green dragon incremental build: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/42185/

It looks like the failures are all related to platforms in some ways.

Yeah, I'm pretty sure its due to this patch. Though the failures don't look near as bad as I feared. :)

I've reverted the patch while I work on a fix. Do let me know if you see some other failures related to this, particularly in some more exotic (remote/on-device/on-simulator) modes.