[llvm-dev] lit improvement

Dan Liew via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 6 00:00:19 PDT 2015

Hi Andrei

On 5 August 2015 at 09:31, Jonathan Roelofs <jonathan at codesourcery.com> wrote:
> On 8/5/15 3:20 AM, Andrei Serebro wrote:
>> Hi,
>> Me and my supervisor are interested in improving llvm’s lit a little
>> bit. Currently, there are few things, that seem to be not very
>> convenient about the tool:
>> ·Having several RUN commands in a failing test, it’s impossible to
>> figure out, which of them actually caused the test to fail. We can
>> output the number of the failing RUN line.

You don't need to implement this because this works in lit today.

By default on non Windows systems lit use's the system's shell and
won't tell you how a sequence of RUN commands failed. However if you
use lit's internal shell then it will tell you the standard output,
standard error and exit code of each RUN line.

Here's an example. Take test/Feature/packed.ll and add an extra RUN line

RUN: false

now run

$ LIT_USE_INTERNAL_SHELL=1 llvm-lit test/Feature/packed.ll

It's worth noting that this environment is specific to LLVM's
lit.site.cfg file which is used to control the ``execute_external``
variable passed in.


If you're using lit for your own projects you just need to pass True
to lit.format.ShTest in your own configuration.

Hope that helps.

More information about the llvm-dev mailing list