diff options
| author | Nicolas Catania <niko@google.com> | 2009-06-04 22:42:51 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-06-04 22:42:51 -0700 |
| commit | 1364a6f3e1f2c39fe4f33fcfe5e4fa80525a8b4f (patch) | |
| tree | 3f68989584ed7c561d612f9a447e53d9269cb5f7 /testrunner | |
| parent | db014ae68e878c3098a6f1298afd195a6dba752f (diff) | |
| parent | ab80b39f160a07bf7bd18a84c07c7e2acedb7249 (diff) | |
| download | android_development-1364a6f3e1f2c39fe4f33fcfe5e4fa80525a8b4f.tar.gz android_development-1364a6f3e1f2c39fe4f33fcfe5e4fa80525a8b4f.tar.bz2 android_development-1364a6f3e1f2c39fe4f33fcfe5e4fa80525a8b4f.zip | |
am ab80b39f: Fixed valgrind handling issue.
Merge commit 'ab80b39f160a07bf7bd18a84c07c7e2acedb7249'
* commit 'ab80b39f160a07bf7bd18a84c07c7e2acedb7249':
Fixed valgrind handling issue.
Diffstat (limited to 'testrunner')
| -rwxr-xr-x | testrunner/run_command.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/testrunner/run_command.py b/testrunner/run_command.py index ead80f1bd..8cf385b87 100755 --- a/testrunner/run_command.py +++ b/testrunner/run_command.py @@ -146,10 +146,16 @@ def RunHostCommand(binary, valgrind=False): 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], + subproc = subprocess.Popen(["/usr/bin/valgrind", "--tool=memcheck", + "--leak-check=yes", "-q", full_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - subproc.wait() - return subproc.returncode + # Cannot rely on the retcode of valgrind. Instead look for an empty output. + valgrind_out = subproc.communicate()[0].strip() + if valgrind_out: + print valgrind_out + return 1 + else: + return 0 def HasValgrind(): |
