summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfergus.henderson <fergushenderson@users.noreply.github.com>2010-09-10 22:09:18 +0000
committerfergus.henderson <fergushenderson@users.noreply.github.com>2010-09-10 22:09:18 +0000
commitf6dba9bbc0a23518591c7cd63764a7f5dcbc6a69 (patch)
tree42ebe9a57ad4dfc769836cbe37bc92f94ad853c1
parent2b2f21035615d26a11ba7954365c271c40071569 (diff)
downloaddistcc-git-f6dba9bbc0a23518591c7cd63764a7f5dcbc6a69.tar.gz
Fix failures of the Gdb_* test cases:
1. These tests were failing if you have anything in your ~/.gdbinit file that causes gdb to issue an error message. The fix here is to create an empty .gdbinit in the test directory; gdb will read that one in preference to the one in $HOME. 2. These tests were failing due to a new spurious warning from gdb. 3. There were a bug in the code for the Gdb_Case test which previously caused part of the test to be executed only in pump mode. When invoking gcc to check whether preprocessing preserves the pwd info, the command line had not been updated to reflect the fact that this command is run in a subdirectory; as a consequence, gcc_preprocessing_preserves_pwd was always set to false. Reviewed by Craig Silverstein.
-rwxr-xr-xtest/testdistcc.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/test/testdistcc.py b/test/testdistcc.py
index a94d086..1d0195f 100755
--- a/test/testdistcc.py
+++ b/test/testdistcc.py
@@ -1218,6 +1218,14 @@ class Gdb_Case(CompileHello_Case):
pass
return "src/testtmp.c"
+ def createSource(self):
+ CompileHello_Case.createSource(self)
+ # Create an empty .gdbinit, so that we insulate this test
+ # from the ~/.gdbinit file of the user running it.
+ filename = ".gdbinit"
+ f = open(filename, 'w')
+ f.close()
+
def compiler(self):
"""Command for compiling and linking."""
return _gcc + " -g ";
@@ -1270,12 +1278,15 @@ class Gdb_Case(CompileHello_Case):
out, errs = self.runcmd("gdb --batch --command=gdb_commands "
"link/%s </dev/null" % testtmp_exe)
# Normally we expect the stderr output to be empty.
- # But, due two gdb bugs, some versions of gdb will produce a
+ # But, due to gdb bugs, some versions of gdb will produce a
# (harmless) error or warning message.
- # In both of these cases, we can safely ignore the message.
- error_message1 = 'Failed to read a valid object file image from memory.\n'
- error_message2 = 'warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4\n'
- if errs and errs != error_message1 and errs != error_message2:
+ # In these cases, we can safely ignore the message.
+ ignorable_error_messages = (
+ 'Failed to read a valid object file image from memory.\n',
+ 'warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4\n',
+ 'warning: no loadable sections found in added symbol-file /usr/lib/debug/lib/ld-2.7.so\n',
+ )
+ if errs and errs not in ignorable_error_messages:
self.assert_equal(errs, '')
self.assert_re_search('puts\\(HELLO_WORLD\\);', out)
self.assert_re_search('testtmp.c:[45]', out)
@@ -1293,13 +1304,14 @@ class Gdb_Case(CompileHello_Case):
self.runcmd("cp ../link/%s ./%s" % (testtmp_exe, testtmp_exe))
pump_mode = _server_options.find('cpp') != -1
error_rc, _, _ = self.runcmd_unchecked(self.compiler() +
- " -g -E -I. -c %s | grep `pwd` >/dev/null" % self.sourceFilename())
+ " -g -E -I.. -c ../%s | grep `pwd` >/dev/null" %
+ self.sourceFilename())
gcc_preprocessing_preserves_pwd = (error_rc == 0);
if ((pump_mode and _IsElf('./%s' % testtmp_exe))
or ((not pump_mode) and gcc_preprocessing_preserves_pwd)):
out, errs = self.runcmd("gdb --batch --command=../gdb_commands "
"./%s </dev/null" % testtmp_exe)
- if errs and errs != error_message1 and errs != error_message2:
+ if errs and errs not in ignorable_error_messages:
self.assert_equal(errs, '')
self.assert_re_search('puts\\(HELLO_WORLD\\);', out)
self.assert_re_search('testtmp.c:[45]', out)