Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4327)

Unified Diff: build/android/generate_emma_html.py

Issue 23506003: [Android] Add a cleanup option to generate_emma_html.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit fixed Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/buildbot/bb_device_steps.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/generate_emma_html.py
diff --git a/build/android/generate_emma_html.py b/build/android/generate_emma_html.py
index a226343e973744a20438342a97c4502474f7f41d..1b00a329cbe156a38f0d496a33d0efccac0d1111 100755
--- a/build/android/generate_emma_html.py
+++ b/build/android/generate_emma_html.py
@@ -38,17 +38,19 @@ def _GetFilesWithExt(root_dir, ext):
def main(argv):
option_parser = optparse.OptionParser()
- option_parser.add_option('-o', '--output', help='HTML output filename.')
- option_parser.add_option('-c', '--coverage-dir', default=None,
+ option_parser.add_option('--output', help='HTML output filename.')
+ option_parser.add_option('--coverage-dir', default=None,
help=('Root of the directory in which to search for '
'coverage data (.ec) files.'))
- option_parser.add_option('-m', '--metadata-dir', default=None,
+ option_parser.add_option('--metadata-dir', default=None,
help=('Root of the directory in which to search for '
'coverage metadata (.em) files.'))
+ option_parser.add_option('--cleanup', action='store_true',
+ help='If set, removes coverage/metadata files.')
options, args = option_parser.parse_args()
if not (options.coverage_dir and options.metadata_dir and options.output):
- option_parser.error('All arguments are required.')
+ option_parser.error('One or more mandatory options are missing.')
coverage_files = _GetFilesWithExt(options.coverage_dir, 'ec')
metadata_files = _GetFilesWithExt(options.metadata_dir, 'em')
@@ -88,6 +90,10 @@ def main(argv):
'emma', 'report', '-r', 'html']
+ input_args + output_args + source_args)
+ if options.cleanup:
+ for f in coverage_files + metadata_files:
+ os.remove(f)
+
if exit_code > 0:
return exit_code
elif err:
« no previous file with comments | « build/android/buildbot/bb_device_steps.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698