Made valgrind optional. Capture the target output.

Don't fail if valgrind (system version not the google3 one) is missing.
If the test fail, print the output of the test.
Added .pyc to the gitignore file.
This commit is contained in:
Nicolas Catania
2009-05-14 12:25:23 -07:00
parent c15ed2d771
commit bcd93dc46a
3 changed files with 28 additions and 5 deletions

View File

@@ -145,7 +145,20 @@ def RunHostCommand(binary, valgrind=False):
print subproc.communicate()[0]
return subproc.returncode
else:
# Need the full path to valgrind to avoid other versions on the system.
subproc = subprocess.Popen(["/usr/bin/valgrind", "-q", full_path],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
subproc.wait()
return subproc.returncode
def HasValgrind():
"""Check that /usr/bin/valgrind exists.
We look for the fullpath to avoid picking up 'alternative' valgrind
on the system.
Returns:
True if a system valgrind was found.
"""
return os.path.exists("/usr/bin/valgrind")