diff options
author | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-10 11:51:29 +0000 |
---|---|---|
committer | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-10 11:51:29 +0000 |
commit | d267ee95429eca5bff2e2d499725ca222848a1cf (patch) | |
tree | f0e48a742304deccd14406482dc4be08b07acb68 /tools/valgrind/tsan_analyze.py | |
parent | b1df09c7e09e9578531e97aeb5e0a5ac92447234 (diff) | |
download | chromium_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/tsan_analyze.py')
-rw-r--r-- | tools/valgrind/tsan_analyze.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/valgrind/tsan_analyze.py b/tools/valgrind/tsan_analyze.py index dcb5060..9ddcdb4 100644 --- a/tools/valgrind/tsan_analyze.py +++ b/tools/valgrind/tsan_analyze.py @@ -47,6 +47,7 @@ class TsanAnalyze: THREAD_CREATION_STR = ("INFO: T.* " "(has been created by T.* at this point|is program's main thread)") + SANITY_TEST_SUPPRESSION = "ThreadSanitizer sanity test" def __init__(self, source_dir, files, use_gdb=False): '''Reads in a set of files. @@ -131,15 +132,19 @@ class TsanAnalyze: self.used_suppressions[supp_name] = count self.cur_fd_.close() - def Report(self): + def Report(self, check_sanity=False): + is_sane = False print "-----------------------------------------------------" print "Suppressions used:" print " count name" for item in sorted(self.used_suppressions.items(), key=lambda (k,v): (v,k)): print "%7s %s" % (item[1], item[0]) + if item[0].startswith(TsanAnalyze.SANITY_TEST_SUPPRESSION): + is_sane = True print "-----------------------------------------------------" sys.stdout.flush() + retcode = 0 if len(self.races) > 0: logging.error("Found %i race reports" % len(self.races)) for report_list in self.races: @@ -147,7 +152,15 @@ class TsanAnalyze: for line in report_list: report += str(line) logging.error('\n' + report) - 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 race reports found") return 0 |