OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # valgrind_test.py | 6 # valgrind_test.py |
7 | 7 |
8 """Runs an exe through Valgrind and puts the intermediate files in a | 8 """Runs an exe through Valgrind and puts the intermediate files in a |
9 directory. | 9 directory. |
10 """ | 10 """ |
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 # http://code.google.com/p/data-race-test/wiki/RaceVerifier for more details. | 896 # http://code.google.com/p/data-race-test/wiki/RaceVerifier for more details. |
897 class ThreadSanitizerRV1Analyzer(tsan_analyze.TsanAnalyzer): | 897 class ThreadSanitizerRV1Analyzer(tsan_analyze.TsanAnalyzer): |
898 """ TsanAnalyzer that saves race reports to a file. """ | 898 """ TsanAnalyzer that saves race reports to a file. """ |
899 | 899 |
900 TMP_FILE = "rvlog.tmp" | 900 TMP_FILE = "rvlog.tmp" |
901 | 901 |
902 def __init__(self, source_dir, use_gdb): | 902 def __init__(self, source_dir, use_gdb): |
903 super(ThreadSanitizerRV1Analyzer, self).__init__(source_dir, use_gdb) | 903 super(ThreadSanitizerRV1Analyzer, self).__init__(source_dir, use_gdb) |
904 self.out = open(self.TMP_FILE, "w") | 904 self.out = open(self.TMP_FILE, "w") |
905 | 905 |
906 def Report(self, files, check_sanity=False): | 906 def Report(self, files, testcase, check_sanity=False): |
| 907 # TODO(timurrrr): handle testcase? |
907 reports = self.GetReports(files) | 908 reports = self.GetReports(files) |
908 for report in reports: | 909 for report in reports: |
909 print >>self.out, report | 910 print >>self.out, report |
910 if len(reports) > 0: | 911 if len(reports) > 0: |
911 logging.info("RaceVerifier pass 1 of 2, found %i reports" % len(reports)) | 912 logging.info("RaceVerifier pass 1 of 2, found %i reports" % len(reports)) |
912 return -1 | 913 return -1 |
913 return 0 | 914 return 0 |
914 | 915 |
915 def CloseOutputFile(self): | 916 def CloseOutputFile(self): |
916 self.out.close() | 917 self.out.close() |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 platform_name = sys.platform + "(Unknown)" | 1138 platform_name = sys.platform + "(Unknown)" |
1138 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, | 1139 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, |
1139 platform_name) | 1140 platform_name) |
1140 | 1141 |
1141 def CreateTool(tool): | 1142 def CreateTool(tool): |
1142 return ToolFactory().Create(tool) | 1143 return ToolFactory().Create(tool) |
1143 | 1144 |
1144 if __name__ == '__main__': | 1145 if __name__ == '__main__': |
1145 logging.error(sys.argv[0] + " can not be run from command line") | 1146 logging.error(sys.argv[0] + " can not be run from command line") |
1146 sys.exit(1) | 1147 sys.exit(1) |
OLD | NEW |