diff --git a/llvm/utils/lit/lit/LitConfig.py b/llvm/utils/lit/lit/LitConfig.py --- a/llvm/utils/lit/lit/LitConfig.py +++ b/llvm/utils/lit/lit/LitConfig.py @@ -27,7 +27,6 @@ params, config_prefix = None, maxIndividualTestTime = 0, parallelism_groups = {}, - echo_all_commands=False, script_output_style=OutputSettings.NO_SCRIPT, command_output_style=OutputSettings.ONLY_FAILING_COMMAND): # The name of the test runner. @@ -68,7 +67,13 @@ self.maxIndividualTestTime = maxIndividualTestTime self.parallelism_groups = parallelism_groups - self.echo_all_commands = echo_all_commands + # If we call out to an external shell, we ask for all output, + # regardless of whether we're going to display all commands that were + # run, or only the last command which failed. + self.run_with_command_output = ( + (command_output_style + == OutputSettings.UP_TO_AND_INCLUDING_FAILING_COMMAND) + or command_output_style == OutputSettings.ONLY_FAILING_COMMAND) self.script_output_style = script_output_style self.command_output_style = command_output_style diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py --- a/llvm/utils/lit/lit/TestRunner.py +++ b/llvm/utils/lit/lit/TestRunner.py @@ -961,7 +961,7 @@ if isWin32CMDEXE: for i, ln in enumerate(commands): commands[i] = re.sub(kPdbgRegex, "echo '\\1' > nul && ", ln) - if litConfig.echo_all_commands: + if litConfig.run_with_command_output: f.write('@echo on\n') else: f.write('@echo off\n') @@ -971,7 +971,7 @@ commands[i] = re.sub(kPdbgRegex, ": '\\1'; ", ln) if test.config.pipefail: f.write(b'set -o pipefail;' if mode == 'wb' else 'set -o pipefail;') - if litConfig.echo_all_commands: + if litConfig.run_with_command_output: f.write(b'set -x;' if mode == 'wb' else 'set -x;') if sys.version_info > (3,0) and mode == 'wb': f.write(bytes('{ ' + '; } &&\n{ '.join(commands) + '; }', 'utf-8')) diff --git a/llvm/utils/lit/lit/cl_arguments.py b/llvm/utils/lit/lit/cl_arguments.py --- a/llvm/utils/lit/lit/cl_arguments.py +++ b/llvm/utils/lit/lit/cl_arguments.py @@ -175,7 +175,6 @@ opts.show_output_on_failure = True opts.script_output_style = OutputSettings.NO_SCRIPT opts.command_output_style = OutputSettings.ONLY_FAILING_COMMAND - opts.echo_all_commands = True if opts.quiet: opts.show_output_on_failure = False @@ -186,14 +185,6 @@ OutputSettings.UP_TO_AND_INCLUDING_FAILING_COMMAND ) - # If we call out to an external shell, we ask for all output, - # regardless of whether we're going to display all commands that were run, - # or only the last command which failed. - cmd_output_style = opts.command_output_style - opts.echo_all_commands = ( - cmd_output_style == OutputSettings.UP_TO_AND_INCLUDING_FAILING_COMMAND - or cmd_output_style == OutputSettings.ONLY_FAILING_COMMAND) - # TODO(python3): Could be enum if opts.shuffle: opts.order = 'random' diff --git a/llvm/utils/lit/lit/main.py b/llvm/utils/lit/lit/main.py --- a/llvm/utils/lit/lit/main.py +++ b/llvm/utils/lit/lit/main.py @@ -37,7 +37,6 @@ isWindows=is_windows, params=params, config_prefix=opts.configPrefix, - echo_all_commands=opts.echo_all_commands, script_output_style=opts.script_output_style, command_output_style=opts.command_output_style)