[PATCH] D35396: [lit] Remove %T

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 16:48:59 PDT 2017


MatzeB added a comment.

In https://reviews.llvm.org/D35396#875872, @Lekensteyn wrote:

> While at it, could the documentation also be clarified whether `%t` refers to a prefix (or note that it is created in a subdirectory such that one can know for sure that it is cleaned up)? A lot of tests use something like `%clang -o %t.o`.


%t is just a name/string that is based on the tests name and is therefore guaranteed to be unique for each test. There is no automatic cleanup, in fact I believe you don't want automatic cleanup as you want to inspect the intermediate results in case of errors.
However I believe the %t path is always in a subdirectory called `Output` so if you wanted to cleanup intermediate results between test-suite runs you could do something like `find build/test -d -name "Output" -exec rm -rf {} ';'`

> As for whether `mkdir -p` can be used or not, based on a look in `utils/lit/`, there does not seem to be a special case for that. Very few builtins (`export`, `echo`, `cd`) are handled. Perhaps it would be worth adding more builtins and/or document whether it is safe to use those? Looking at a Windows builder (http://lab.llvm.org:8011/buildslaves/windows7-buildbot) though, the `Profile/gcc-flag-compatibility.c` test does get executed properly (it uses `rm -rf` and `mkdir -p ../..`).

The tests assume this is possible even on windows. So the expectation is that whoever runs the tests has those GnuWin32 tools installed.

> @rnk Are the GnuWin32 tools just needed for the test suite or is it also needed for the build process? (Linux user here, no idea how LLVM is usually developed on Windows)

docs/GettingStartedVS.rst sounds like GnuWin32 is only needed for the tests.


https://reviews.llvm.org/D35396





More information about the llvm-commits mailing list