This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Use the basename of the Python test for the log name instead of the class name
AbandonedPublic

Authored by teemperor on Jul 14 2020, 6:21 AM.

Details

Summary

From what I know we already have the restriction that every test in the test suite needs
to have a unique file name as that's used for generating the unique build directory for
a test. It seems there is also a restriction that every test case class in the test suite needs
to have a unique name as that's used to generate the unique log file name for the test run.

This changes the log file format to use the basename of the test file instead so that we
only have to keep worrying about the 'unique file name' restriction from now on.

This came up because I started naming the test classes "TestCase" (as repeating the file
name in the test class seems like redudant information that just makes renaming tests
a pain).

Diff Detail

Event Timeline

teemperor created this revision.Jul 14 2020, 6:21 AM
labath accepted this revision.Jul 14 2020, 6:58 AM

I (ab)used the ability to have multiple classes in a file to run different "flavours" of an inline test in a couple of files. This will probably cause those tests to overwrite their log files, but this:
a) won't be racy because the tests within one file are run serially
b) can be fixed by giving inline log files special names, just like we already did for build directories

TBH, I'm not sure if we really need this all this flexibility with the log files. If it were up to me, I'd just put them inside the test build directories (back when this was created we were still building tests in-tree), without any fancy names and call it a day.

This revision is now accepted and ready to land.Jul 14 2020, 6:58 AM
JDevlieghere added inline comments.Jul 14 2020, 10:52 AM
lldb/test/API/CMakeLists.txt
41

Why do we override the session file format in the first place? The default in configuration.py is fnmac which should be unique.

teemperor marked an inline comment as done.Jul 14 2020, 10:53 AM
teemperor added inline comments.
lldb/test/API/CMakeLists.txt
41

The speculation in IRC was that it's because of Windows + long file names.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2020, 4:55 AM
teemperor reopened this revision.Jul 15 2020, 7:28 AM

Well, on Windows the file name is for some reason always "lldbsuite.test.lldbtest" so I reverted this for now. Open for suggestions.

This revision is now accepted and ready to land.Jul 15 2020, 7:28 AM

Well, on Windows the file name is for some reason always "lldbsuite.test.lldbtest" so I reverted this for now. Open for suggestions.

I'm on board with Pavel's suggestion of getting rid of the session dir and format and just adding the log to the build dir.

teemperor planned changes to this revision.Jul 27 2020, 6:42 AM

Got reverted, so back to my TODO queue.