diff options
Diffstat (limited to 'tools/valgrind/valgrind_test.py')
-rwxr-xr-x | tools/valgrind/valgrind_test.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/valgrind/valgrind_test.py b/tools/valgrind/valgrind_test.py index 4afb714..0910e0c 100755 --- a/tools/valgrind/valgrind_test.py +++ b/tools/valgrind/valgrind_test.py @@ -56,6 +56,12 @@ class Valgrind(object): help="path to a valgrind suppression file") self._parser.add_option("", "--gtest_filter", default="", help="which test case to run") + self._parser.add_option("", "--gtest_print_time", action="store_true", + default=False, + help="show how long each test takes") + self._parser.add_option("", "--show_all_leaks", action="store_true", + default=False, + help="also show less blatant leaks") self._parser.add_option("", "--generate_suppressions", action="store_true", default=False, help="Skip analysis and generate suppressions") @@ -72,6 +78,8 @@ class Valgrind(object): self._source_dir = self._options.source_dir if self._options.gtest_filter != "": self._args.append("--gtest_filter=%s" % self._options.gtest_filter) + if self._options.gtest_print_time: + self._args.append("--gtest_print_time"); if self._options.verbose: google.logging_utils.config_root(logging.DEBUG) else: @@ -108,7 +116,7 @@ class Valgrind(object): def Analyze(self): # Glob all the files in the "valgrind.tmp" directory filenames = glob.glob(self.TMP_DIR + "/valgrind.*") - analyzer = valgrind_analyze.ValgrindAnalyze(self._source_dir, filenames) + analyzer = valgrind_analyze.ValgrindAnalyze(self._source_dir, filenames, self._options.show_all_leaks) return analyzer.Report() def Cleanup(self): @@ -167,6 +175,9 @@ class ValgrindLinux(Valgrind): proc = ["valgrind", "--smc-check=all", "--leak-check=full", "--num-callers=30"] + if self._options.show_all_leaks: + proc += ["--show-reachable=yes"]; + # Either generate suppressions or load them. if self._generate_suppressions: proc += ["--gen-suppressions=all"] |