about summary refs log tree commit diff
path: root/scripts/test_printers_common.py
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2019-02-08 13:49:19 -0500
committerDJ Delorie <dj@redhat.com>2019-02-14 16:28:03 -0500
commit56a731d4ad319e473851893980e734b7ee42c1a0 (patch)
treed004eb5354a84d7744c1cea2d04fd569e38dc06f /scripts/test_printers_common.py
parent712182c8dcc43e34a265268fb209b9dd20967f1e (diff)
downloadglibc-56a731d4ad319e473851893980e734b7ee42c1a0.tar.gz
glibc-56a731d4ad319e473851893980e734b7ee42c1a0.tar.xz
glibc-56a731d4ad319e473851893980e734b7ee42c1a0.zip
Avoid readline conflicts in pexpect
In some cases, sensitive to readline version and the user's
environment, gdb might emit escape codes while run under python's
pexpect (i.e. testing pretty printers).  This patch, suggested
by Jan, helps isolate the test from the user's environment.

Tested on RHEL 7 x86_64 with DTS 7 and EPEL, which is one
magic combination of components that triggers this bug.
Diffstat (limited to 'scripts/test_printers_common.py')
-rw-r--r--scripts/test_printers_common.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/test_printers_common.py b/scripts/test_printers_common.py
index dada6aadde..b2bd4ba1cc 100644
--- a/scripts/test_printers_common.py
+++ b/scripts/test_printers_common.py
@@ -60,6 +60,10 @@ TIMEOUTFACTOR = os.environ.get('TIMEOUTFACTOR')
 if TIMEOUTFACTOR:
     timeout = int(TIMEOUTFACTOR)
 
+# Otherwise GDB is run in interactive mode and readline may send escape
+# sequences confusing output for pexpect.
+os.environ["TERM"]="dumb"
+
 try:
     # Check the gdb version.
     version_cmd = '{0} --version'.format(gdb_invocation, timeout=timeout)