[LLVMdev] [PATCH] A "very verbose" mode for FileCheck

Chris Lattner clattner at apple.com
Wed Jan 16 11:24:13 PST 2013


On Jan 16, 2013, at 10:32 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:

> Hello,
> 
> When someone breaks a FileCheck-based test on some buildbot, sometimes
> it may not be obvious *why* did it fail.  If the failure can not be
> reproduced locally, it can be very hard to fix.
> 
> I propose adding a "very verbose" mode to FileCheck.  In this mode
> FileCheck will dump the input file in case of failure.  This mode will
> be enabled by an environment variable "FILECHECK_VERY_VERBOSE".  If we
> chose a command line option, we would have to edit all FileCheck-based
> tests to use %FileCheck.

I think that this idea is good, but I'd prefer it be implemented a different way:

 - Filecheck should take a new flag -dump-input-on-error that causes it to... dump the input file on error.
 - Lit should be the thing that checks the environment (or perhaps add a new option to lit), and adds the flag to FileCheck invocations.

I don't like it when the behavior of such a low-level tool like this changes based on environment variables.  It isn't discoverable in --help.  If for some reason, it is bad for lit to implicitly pass the option, I'd rather have a standard FILECHECK_COMMANDLINE environment variable, and have filecheck parse arbitrary options out of it using the cl::ParseEnvironmentOptions function.

-Chris 



More information about the llvm-dev mailing list