[PATCH] D52999: [FileCheck] Annotate input dump (1/7)

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 30 14:22:29 PDT 2018


zturner added inline comments.


================
Comment at: llvm/docs/CommandGuide/FileCheck.rst:80-82
+.. option:: --dump-input <mode>
+
+  Dump annotated original input either 'always', on 'fail', or 'never'.
----------------
I haven't been following this too closely, but I'm wondering, are the 3 modes actually necessary?  It sounds like the main use case here is that the user has a failure and wants to get more info.  So they will set it to either `fail` or `always`.  But do they care which?  Basically, what I'm wondering is why not just make this be a binary on flag?

It just seems simpler to say that if you want to dump the input, pass `--dump-input`, and if you don't want to dump the input, pass nothing.  


================
Comment at: llvm/test/FileCheck/match-full-lines.txt:4-7
+// RUN: not FileCheck -dump-input=never -match-full-lines -input-file %s %s  2>&1 \
 // RUN:   | FileCheck --check-prefix=ERROR --implicit-check-not=error: %s
-// RUN: not FileCheck -match-full-lines -strict-whitespace -input-file %s %s  2>&1 \
+// RUN: not FileCheck -dump-input=never -match-full-lines -strict-whitespace -input-file %s %s  2>&1 \
 // RUN:   | FileCheck --check-prefix=ERROR-STRICT --check-prefix=ERROR --implicit-check-not=error: %s
----------------
You could also achieve this without the command line flag by writing `env FILECHECK_DUMP_INPUT= not FileCheck ...`.  Pretty sure you can unset a variable and run a command this way.


Repository:
  rL LLVM

https://reviews.llvm.org/D52999





More information about the llvm-commits mailing list