This is an archive of the discontinued LLVM Phabricator instance.

[test] Add dotest wrapper
ClosedPublic

Authored by JDevlieghere on Mar 2 2018, 3:51 AM.

Details

Summary

This adds a wrapper around dotest, similar to llvm-lit in llvm. The
wrapper is created in the binary directory, next to LLDB and allows you
to invoke dotest without having to pass any of the configuration
arguments yourself. I think this could also be useful for re-running a
particular test case when it fails, as an alternative to "Command
Invoked".

The motivation for this is that I'd like to replace the driver part of
dotest with lit. As a first step, I'd like to have lit invoke dotest,
which would just run the complete test suite, completely identical to
what the CMake target does today. Once this is in place, we can have lit
run dotest for the different test directories, and ultimately once per
python file. Along the way we can strip out driver functionality from
dotest where appropriate.

Please let me know what you think about this!

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Mar 2 2018, 3:51 AM

Thanks for working on this! Have you thought about how this would work for a bot that wants to run the dotest testsuite against multiple compilers (clang trunk, clang-6.0, clang-5.0, , ...)?

Thanks for working on this! Have you thought about how this would work for a bot that wants to run the dotest testsuite against multiple compilers (clang trunk, clang-6.0, clang-5.0, , ...)?

I must admit I haven't. I'm guessing you mean specifically for doing that in combination with lit?

If it's just this one variable that's undecided at compile time, I think we can work around this. Lit itself supports you to pass variables with the -D prefix, which could be used to pass a different compiler to dotest. The wrapper itself would just forward that argument. I assume there is (and if there isn't it's trivial to add) support for overwriting the compiler?

FWIW I've been using this all day and so far it has been nothing but really convenient, even if I say so myself ๐Ÿ™‚

labath added a comment.Mar 2 2018, 9:44 AM

I've been wanting to implement some thing like this myself, but I did not attempt it because of the issue of integration with the xcode project. If you can handle that part, then I'm all for it.

Having just a dotest frontend with hardcoded default options is fine, but when we start a more deeper integrations we will need to think about the different config issue that Adrian pointed out. BTW, the compiler is not the only config option that is variable. For local builds there is at least the "--arch" option (so you can test 32-bit capabilities). Then for remote testing you also have the --platform-*** family of options. And our bots also use the --skip-category option selectively (to skip watchpoint tests, as some devices don't support them).

test/dotest.in
1โ€“3

I think this should be a python file, for the sake of windows folks.

I must admit I haven't. I'm guessing you mean specifically for doing that in combination with lit?

I haven't either :-)
But I would really like to have a bot the builds lldb, runs (what we call today) lit tests and the unittests, and then runs the dotest tests in a number of different configurations with different compilers.

I assume there is (and if there isn't it's trivial to add) support for overwriting the compiler?

Which tool are you referring to, lit?

We could take this even one step further, by either elevating the big categories (dwarf, dsym, dwo) on the same level as the compiler choice (e.g., run the testsuite for (clang-6.0, dwo)), *or* by sinking the compiler choice into test matrix inside of dotest (basically dotest would accept a list of compilers).

labath added a comment.Mar 2 2018, 9:55 AM

We could take this even one step further, by either elevating the big categories (dwarf, dsym, dwo) on the same level as the compiler choice (e.g., run the testsuite for (clang-6.0, dwo)), *or* by sinking the compiler choice into test matrix inside of dotest (basically dotest would accept a list of compilers).

At one point in the past, dotest accepted a list of compilers and architectures and then ran each test for the cartesian product. However, this was broken for a long time (it operated on a completely different level than the debug flavour thingy) and so it was removed.

vsk accepted this revision.Mar 2 2018, 10:55 AM

The basic approach looks good -- lgtm with Pavel's comment addressed. Thanks!

This revision is now accepted and ready to land.Mar 2 2018, 10:55 AM
davide accepted this revision.Mar 3 2018, 11:09 AM

We could take this even one step further, by either elevating the big categories (dwarf, dsym, dwo) on the same level as the compiler choice (e.g., run the testsuite for (clang-6.0, dwo)), *or* by sinking the compiler choice into test matrix inside of dotest (basically dotest would accept a list of compilers).

At one point in the past, dotest accepted a list of compilers and architectures and then ran each test for the cartesian product. However, this was broken for a long time (it operated on a completely different level than the debug flavour thingy) and so it was removed.

That's a good thing. I'm really not in favor of having this cartesian explosion. If people want to run multiple configuration, then it needs to happen in some principled manner (if anything, the cmdline should be generated by a textual configuration representation, YAML or JSON or something else).

About the patch itself, LGTM. I wonder whether we should call the binary lldb-dotest. But I don't feel really strong about it, so go for whatever you like.

JDevlieghere closed this revision.Mar 5 2018, 2:10 AM

Thanks for the feedback everyone! I committed this in r326687.