[lldb][test] Handle .categories lookup for inline tests.
authorJordan Rupprecht <rupprecht@google.com>
Fri, 6 Dec 2019 16:36:23 +0000 (08:36 -0800)
committerJordan Rupprecht <rupprecht@google.com>
Fri, 6 Dec 2019 16:36:23 +0000 (08:36 -0800)
commit03a242bd41ee49e17f8da96af9787d13e7ea2b93
tree427ce7700b3656eb6079f2084573938bcce6e806
parent984f1bb3e794b83da5dde9440f9807c645e8e6db
[lldb][test] Handle .categories lookup for inline tests.

Summary:
When creating a test with `lldbinline.MakeInlineTest()`, the reported `inspect.getfile(test.__class__)` is `lldbtest.pyc`, meaning any `.categories` file will be ineffective for those tests. Check for the test_filename first, which inline tests will set.

Additionally, raise an error with the starting dir if `.categories` is not found. This makes the problem more obvious when it occurs: when the test is separated from the test framework tree.

Reviewers: labath, JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D71099
lldb/packages/Python/lldbsuite/test/test_result.py