summaryrefslogtreecommitdiffstats
path: root/tools/valgrind/memcheck_analyze.py
diff options
context:
space:
mode:
authorglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 11:51:29 +0000
committerglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 11:51:29 +0000
commitd267ee95429eca5bff2e2d499725ca222848a1cf (patch)
treef0e48a742304deccd14406482dc4be08b07acb68 /tools/valgrind/memcheck_analyze.py
parentb1df09c7e09e9578531e97aeb5e0a5ac92447234 (diff)
downloadchromium_src-d267ee95429eca5bff2e2d499725ca222848a1cf.zip
chromium_src-d267ee95429eca5bff2e2d499725ca222848a1cf.tar.gz
chromium_src-d267ee95429eca5bff2e2d499725ca222848a1cf.tar.bz2
Added sanity checks for base_unittests to Memcheck and ThreadSanitizer test runners.
Note that the sanity checks may fail if the tests are ran with the sanity tests excluded (e.g. local test runs). I suppose this shouldn't be a problem, because the exit code matters only on buildbots. Review URL: http://codereview.chromium.org/598013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/valgrind/memcheck_analyze.py')
-rwxr-xr-xtools/valgrind/memcheck_analyze.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/valgrind/memcheck_analyze.py b/tools/valgrind/memcheck_analyze.py
index af5d09d..c70df99 100755
--- a/tools/valgrind/memcheck_analyze.py
+++ b/tools/valgrind/memcheck_analyze.py
@@ -311,6 +311,7 @@ class MemcheckAnalyze:
''' Given a set of Valgrind XML files, parse all the errors out of them,
unique them and output the results.'''
+ SANITY_TEST_SUPPRESSION = "Memcheck sanity test"
def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False):
'''Reads in a set of files.
@@ -429,19 +430,23 @@ class MemcheckAnalyze:
logging.warn("Last 20 lines of %s :" % file)
os.system("tail -n 20 '%s' 1>&2" % file)
- def Report(self):
+ def Report(self, check_sanity=False):
if self._parse_failed:
logging.error("FAIL! Couldn't parse Valgrind output file")
return -2
+ is_sane = False
print "-----------------------------------------------------"
print "Suppressions used:"
print " count name"
for item in sorted(self._suppcounts.items(), key=lambda (k,v): (v,k)):
print "%7s %s" % (item[1], item[0])
+ if item[0].startswith(MemcheckAnalyze.SANITY_TEST_SUPPRESSION):
+ is_sane = True
print "-----------------------------------------------------"
sys.stdout.flush()
+ retcode = 0
if self._errors:
logging.error("FAIL! There were %s errors: " % len(self._errors))
@@ -452,7 +457,15 @@ class MemcheckAnalyze:
for error in self._errors:
logging.error(error)
- return -1
+ retcode = -1
+
+ # Report tool's insanity even if there were errors.
+ if check_sanity and not is_sane:
+ logging.error("FAIL! Sanity check failed!")
+ retcode = -3
+
+ if retcode != 0:
+ return retcode
logging.info("PASS! No errors found!")
return 0