diff --git a/llvm/utils/lit/tests/lit.cfg b/llvm/utils/lit/tests/lit.cfg --- a/llvm/utils/lit/tests/lit.cfg +++ b/llvm/utils/lit/tests/lit.cfg @@ -35,6 +35,13 @@ else: lit_path = os.path.join(config.test_source_root, '..') +# This test suite calls %{lit} to test lit's behavior for the sample test +# suites in %{inputs}. This test suite's results are then determined in part +# by %{lit}'s textual output, which includes the output of FileCheck calls +# within %{inputs}'s test suites. Thus, %{lit} clears environment variables +# that can affect FileCheck's output. +llvm_config.clear_environment(['FILECHECK_OPTS', 'FILECHECK_DUMP_INPUT_ON_FAILURE']) + # Required because some tests import the lit module llvm_config.with_environment('PYTHONPATH', lit_path, append_path=True) @@ -44,16 +51,10 @@ if directory: llvm_config.with_environment('PATH', directory, append_path=True) -# This test suite calls %{lit} to test lit's behavior for the sample test -# suites in %{inputs}. This test suite's results are then determined in part -# by %{lit}'s textual output, which includes the output of FileCheck calls -# within %{inputs}'s test suites. Thus, %{lit} clears environment variables -# that can affect FileCheck's output. config.substitutions.append(('%{inputs}', os.path.join( config.test_source_root, 'Inputs'))) config.substitutions.append(('%{lit}', - "{env} %{{python}} {lit}".format( - env="env FILECHECK_OPTS= FILECHECK_DUMP_INPUT_ON_FAILURE=", + "%{{python}} {lit}".format( lit=os.path.join(lit_path, 'lit.py')))) config.substitutions.append(('%{python}', '"%s"' % (sys.executable)))