[llvm-lit] Mistakes in list of variables and substitutions documentation?

Hi All,

I was taking a look at [1] because I was modifying an external tool to
use llvm-lit instead of the deprecated DejaGNU testing framework and I
was going to submit a patch to document the undocumented '%T'
substitution when I realised the existing documentation doesn't quite
make sense...

* $test has a '$' prefix whereas most of the others don't.

* I can't see any support for any of these '$' style substitutions
(e.g. subdir, srcroot, objroot) in lit's python code or in the
lit.site.cfg file. The only place I've seen the substitutions
happening is
parseIntegratedTestScript() inside TestRunner.py but they all use the
'%' prefix.

* Why the distinction between variables and substitutions?

[1] http://llvm.org/docs/TestingGuide.html#variables-and-substitutions

Dan Liew

I thought I might get a better response if I provide something more concrete.

Attached is the file subs_and_vars.c which can be placed in 'test/' in the LLVM build directory which can then be executed by doing

$ cd test/
$ llvm-lit -v subs_and_vars.c

The output is shown in the attached file subs_and_vars_llvm-lit.txt.

As it can be seen most of the ('$' prefix) variables described in the documentation do **not** work (expand to nothing) and quite a few undocumented variables and substitutions ('%' prefix) do work.

I'm not saying that all of these should be documented but I don't think the documentation should recommend the use of variables that do not work. I also don't think the documentation should say the '%' substitutions are deprecated when there are no '$' equivalents to replace many '%' substitutions.

In my opinion the llvm-lit in built substitutions (e.g. %s, %T) should be described in the llvm-lit manual [1] and the important lit.site.cfg specific substitutions and variables should be described in [2]

[1] http://llvm.org/docs/CommandGuide/lit.html
[2] http://llvm.org/docs/TestingGuide.html#variables-and-substitutions

I don't mind writing this documentation but I need some guidance on how these variables and substitutions are being used currently by the LLVM community.

Dan Liew.

subs_and_vars.c (1.44 KB)

subs_and_vars_llvm-lit.txt (3.31 KB)


For anyone browsing old e-mails this was fixed by Nico Rieck in r201464.