[PATCH] D56541: Fix FileCheck tests when `FILECHECK_DUMP_INPUT_ON_FAILURE` is set in the environment that llvm-lit is executed in.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 10 05:43:18 PST 2019


delcypher created this revision.
delcypher added reviewers: jdenny, probinson, george.karpenkov.

This fixes the following FileCheck tests:

- FileCheck/dump-input-enable.txt
- FileCheck/match-full-lines.txt

when `FILECHECK_DUMP_INPUT_ON_FAILURE` is set in the environment.

By default llvm-lit propagates `FILECHECK_DUMP_INPUT_ON_FAILURE` from
llvm-lit's environment into the test environment. Unfortunately this
breaks FileCheck's tests because it expects that the environment
variable is normally not set.


Repository:
  rL LLVM

https://reviews.llvm.org/D56541

Files:
  test/FileCheck/lit.local.cfg


Index: test/FileCheck/lit.local.cfg
===================================================================
--- /dev/null
+++ test/FileCheck/lit.local.cfg
@@ -0,0 +1,8 @@
+# Remove FILECHECK_DUMP_INPUT_ON_FAILURE from environment
+# because the tests expect that environment variable is
+# normally unset.
+file_check_dump_env_var = 'FILECHECK_DUMP_INPUT_ON_FAILURE'
+if file_check_dump_env_var in config.environment:
+  lit_config.note('Removing {} from environment for FileCheck tests'.format(
+    file_check_dump_env_var))
+  config.environment.pop(file_check_dump_env_var)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56541.181037.patch
Type: text/x-patch
Size: 574 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190110/783e32da/attachment.bin>


More information about the llvm-commits mailing list