[Lldb-commits] [PATCH] D54731: [lit] Enable the use of custom user-defined lit commands

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 21 04:53:00 PST 2018


labath added a comment.

I think that something like this would go a long way towards solving the problems with lit tests we're having in lldb.

However, the part that is not clear to me is whether it is actually necessary to modify lit (shtest) to achieve this. It seems to me an equivalent effect to the command from the motivating example could be achieved via something like

  RUN: %compile --source=%p/Inputs/foo.cpp --mode=debug --opt=none --link=no --output=%t.o --clean=yes

where `%compile` expands to a python script living somewhere in the lldb repository. This script could do the same thing that the implementation of `COMPILE: ` would do, except it would be done in a separate process.

The only downside of that I see is the extra process will incur some overhead, slowing down the testing, but I am not sure if we care about that (or if it would even be measurable). OTOH, the benefits are:

- decreased complexity of lit
- decreased level of surprise of developers seeing new lit commands
- easier reproducibility of tests when debugging (just copy paste the `%compile` run-line to rebuild the executable)


https://reviews.llvm.org/D54731





More information about the lldb-commits mailing list