@labath raised a concern on the way I was skipping this test. I think that was
fair and I found a better way.
Now I'm skipping if the CMAKE flag LLDB_BUILD_INTEL_PT is false.
I added an enabled_plugins entry in the dotest configuration, which gets
set by lit or lldb-dotest. The only available plugin right now is
'intel-pt', but I imagine it will be useful in the future for other
kinds of plugins that get determined at configuration time. I didn't
want to add a new argument option --enable-intel-pt or something or the
sort, as it wouldn't be useful for other cases.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Checking for presence this way seems ok-ish (definitely better than the environment variable). A possible alternative would be to pass some argument to dotest from cmake which would identify the status of the pt support.
Anyway, if you're going to add a new public API for this purpose, please create a separate patch for that with a test.
Adding @JDevlieghere as he is in the same time zone and knows about all this stuff. This is on the right track, but changing lldb-dotest is not enough -- you'll also need to change test/API/lit.cfg.py as that's what's used for regular "check-lldb" runs. Also, instead of environment variables, please add a command line switch to dotest. Environment variables make it hard to reproduce steps when copy-pasting commands.
lldb/utils/lldb-dotest/lldb-dotest.in | ||
---|---|---|
33 | The usual solution to this is to run llvm_canonicalize_cmake_booleans in cmake. |
Heh.. I wasn't an attempt expecting a fully generic solution. Since we don't invoke dotest.py manually these days (we have lldb-dotest for that) making a separate argument specifically for this plugin would be just fine. However, I don't see anything inherently wrong with this generic approach, so I guess we can leave it. The main think I don't like is the introduction of the skipping code into the base test class. These classes are already more complicated than they ought to be, so I'd like to avoid adding things to them, if those things can be implemented elsewhere.
lldb/packages/Python/lldbsuite/test/lldbtest.py | ||
---|---|---|
736–738 ↗ | (On Diff #256716) | Let's put this stuff in TestIntelPTSimpleBinary for now -- it can be moved into a separate base class (along with other common code) once we have more of these tests. |
The usual solution to this is to run llvm_canonicalize_cmake_booleans in cmake.