From b04b92c3a4640417f2074e7e903df8c2b76eadfd Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Fri, 20 Dec 2019 15:11:49 +0100 Subject: [lldb/pexpect] Force-set the TERM environment variable In some environments (typically, buildbots), this variable may not be available. This can cause tests to behave differently. Explicitly set the variable to "vt100" to ensure consistent test behavior. It should not matter that we do not inherit the process TERM variable, as the child process runs in a new virtual terminal anyway. --- lldb/packages/Python/lldbsuite/test/lldbpexpect.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lldb/packages/Python/lldbsuite/test') diff --git a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py index 13552dca7b9..d599bc39762 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py +++ b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py @@ -1,6 +1,7 @@ from __future__ import absolute_import # System modules +import os import sys # Third-party modules @@ -29,6 +30,7 @@ else: def launch(self, executable=None, extra_args=None, timeout=30, dimensions=None): logfile = getattr(sys.stdout, 'buffer', sys.stdout) if self.TraceOn() else None + args = ['--no-lldbinit', '--no-use-colors'] for cmd in self.setUpCommands(): args += ['-O', cmd] @@ -36,9 +38,13 @@ else: args += ['--file', executable] if extra_args is not None: args.extend(extra_args) + + env = dict(os.environ) + env["TERM"]="vt100" + self.child = pexpect.spawn( lldbtest_config.lldbExec, args=args, logfile=logfile, - timeout=timeout, dimensions=dimensions) + timeout=timeout, dimensions=dimensions, env=env) self.expect_prompt() for cmd in self.setUpCommands(): self.child.expect_exact(cmd) -- cgit v1.2.3