This is an archive of the discontinued LLVM Phabricator instance.

[lldb][tests] Take into account all parent's categories when traverse folders upwards
ClosedPublic

Authored by tatyana-krasnukha on Dec 26 2019, 8:35 AM.

Details

Summary

This is needed to not "re-write" parent's categories by categories of a nested folder,
e.g. commands/expression/completion specify "cmdline" category, however it still belongs
to parent's "expression" category.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptDec 26 2019, 8:35 AM
teemperor edited reviewers, added: JDevlieghere; removed: teemperor.Jan 2 2020, 3:22 AM
JDevlieghere accepted this revision.Jan 2 2020, 8:28 AM
This revision is now accepted and ready to land.Jan 2 2020, 8:28 AM
labath requested changes to this revision.Jan 6 2020, 6:10 AM

The idea seems fine, but I think that the implementation needs more refinement, per the inline comments...

packages/Python/lldbsuite/test/test_result.py
111–112 ↗(On Diff #235348)

This part is no longer true, as we continue searching after finding the first file.

119 ↗(On Diff #235348)

I don't think this will work on windows. I think we should stop iterating here as soon we reach the top level test folder (I don't know how to check that off-hand, but we should have that piece of information available somewhere.) That will also ensure we don't get confused by some spurious .categories file outside of the test tree.

This revision now requires changes to proceed.Jan 6 2020, 6:10 AM
JDevlieghere added inline comments.Jan 6 2020, 10:24 AM
packages/Python/lldbsuite/test/test_result.py
119 ↗(On Diff #235348)

We could use the LLDB source root for this, which is already available from dotest through lldbsuite.lldb_root.

labath added inline comments.Jan 7 2020, 2:42 AM
packages/Python/lldbsuite/test/test_result.py
119 ↗(On Diff #235348)

sounds good.

Stop iterating when reach the top-level test folder

labath accepted this revision.Jan 10 2020, 1:19 AM

lgtm

This revision is now accepted and ready to land.Jan 10 2020, 1:19 AM
This revision was automatically updated to reflect the committed changes.