Chromium Code Reviews| Index: tools/code_coverage/coverage_posix.py |
| =================================================================== |
| --- tools/code_coverage/coverage_posix.py (revision 162133) |
| +++ tools/code_coverage/coverage_posix.py (working copy) |
| @@ -762,6 +762,12 @@ |
| '--directory', self.directory_parent, |
| '--zerocounters']) |
| shutil.rmtree(os.path.join(self.directory, 'coverage')) |
| + if self.options.all_unittests: |
|
John Grabowski
2012/10/30 21:29:05
consider an unconditional delete. It is unclear w
pshenoy
2012/10/30 22:11:13
coverage_posix.py is run twice now. First time run
John Grabowski
2012/10/30 22:17:11
ok
|
| + if os.path.exists(os.path.join(self.directory, 'unittests_coverage')): |
| + shutil.rmtree(os.path.join(self.directory, 'unittests_coverage')) |
| + else: |
| + if os.path.exists(os.path.join(self.directory, 'total_coverage')): |
| + shutil.rmtree(os.path.join(self.directory, 'total_coverage')) |
| def BeforeRunOneTest(self, testname): |
| """Do things before running each test.""" |
| @@ -991,6 +997,22 @@ |
| sys.exit(retcode) |
| if self.IsLinux(): |
| os.chdir(start_dir) |
| + |
| + # Copy the unittests coverage information to a different folder. |
| + if self.options.all_unittests: |
|
John Grabowski
2012/10/30 21:29:05
make the conditional set a var called filename (ei
pshenoy
2012/11/05 17:59:31
I think this is related to the other comment above
John Grabowski
2012/11/06 18:04:05
Sort of, but it would be nice to be pithy. For ex
pshenoy
2012/11/06 19:05:41
Done.
|
| + unittests_dir = os.path.join(self.directory, 'unittests_coverage') |
| + if not os.path.exists(unittests_dir): |
| + os.makedirs(unittests_dir) |
| + shutil.copyfile(self.coverage_info_file, os.path.join(unittests_dir, |
| + 'coverage.info')) |
| + else: |
| + # Save the overall coverage information. |
| + overall_dir = os.path.join(self.directory, 'total_coverage') |
| + if not os.path.exists(overall_dir): |
| + os.makedirs(overall_dir) |
| + shutil.copyfile(self.coverage_info_file, os.path.join(overall_dir, |
| + 'coverage.info')) |
| + |
| if not os.path.exists(self.coverage_info_file): |
| logging.fatal('%s was not created. Coverage run failed.' % |
| self.coverage_info_file) |