summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-12-20 15:11:49 +0100
committerPavel Labath <pavel@labath.sk>2019-12-20 15:19:41 +0100
commitb04b92c3a4640417f2074e7e903df8c2b76eadfd (patch)
treee81c203dc8ef4b7915bb7ec706f5807d5a442d46 /lldb/packages/Python
parent453dc4d7ec5a3c3d8f54fc358bc5673834516d48 (diff)
downloadbcm5719-llvm-b04b92c3a4640417f2074e7e903df8c2b76eadfd.tar.gz
bcm5719-llvm-b04b92c3a4640417f2074e7e903df8c2b76eadfd.zip
[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.
Diffstat (limited to 'lldb/packages/Python')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbpexpect.py8
1 files changed, 7 insertions, 1 deletions
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)
OpenPOWER on IntegriCloud