Index: build/android/generate_emma_html.py |
diff --git a/build/android/generate_emma_html.py b/build/android/generate_emma_html.py |
index 1b00a329cbe156a38f0d496a33d0efccac0d1111..609bd41e27fc3321cc0d88c18ec69df857cdc6b0 100755 |
--- a/build/android/generate_emma_html.py |
+++ b/build/android/generate_emma_html.py |
@@ -56,33 +56,22 @@ def main(argv): |
metadata_files = _GetFilesWithExt(options.metadata_dir, 'em') |
print 'Found coverage files: %s' % str(coverage_files) |
print 'Found metadata files: %s' % str(metadata_files) |
- sources_files = [] |
- final_metadata_files = [] |
- err = None |
+ |
+ sources = [] |
for f in metadata_files: |
sources_file = os.path.splitext(f)[0] + '_sources.txt' |
- # TODO(gkanwar): Remove this once old coverage.em files have been cleaned |
- # from all bots. |
- # Warn if we have old metadata files lying around that don't correspond |
- # to a *_sources.txt (these should be manually cleaned). |
- try: |
- with open(sources_file, 'r') as sf: |
- sources_files.extend(json.load(sf)) |
- except IOError as e: |
- traceback.print_exc() |
- err = e |
- else: |
- final_metadata_files.append(f) |
- sources_files = [os.path.join(constants.DIR_SOURCE_ROOT, s) |
- for s in sources_files] |
+ with open(sources_file, 'r') as sf: |
+ sources.extend(json.load(sf)) |
+ sources = [os.path.join(constants.DIR_SOURCE_ROOT, s) for s in sources] |
+ print 'Sources: %s' % sources |
cjhopman
2013/08/30 17:59:40
Note: this print is new. Just confirming that's in
frankf
2013/08/30 18:12:36
Yea, they've been helpful in debugging.
|
input_args = [] |
- for f in coverage_files + final_metadata_files: |
+ for f in coverage_files + metadata_files: |
input_args.append('-in') |
input_args.append(f) |
output_args = ['-Dreport.html.out.file', options.output] |
- source_args = ['-sp', ','.join(sources_files)] |
+ source_args = ['-sp', ','.join(sources)] |
exit_code = cmd_helper.RunCmd( |
['java', '-cp', |
@@ -91,15 +80,10 @@ def main(argv): |
+ input_args + output_args + source_args) |
if options.cleanup: |
- for f in coverage_files + metadata_files: |
+ for f in coverage_files: |
os.remove(f) |
- if exit_code > 0: |
- return exit_code |
- elif err: |
- return constants.WARNING_EXIT_CODE |
- else: |
- return 0 |
+ return exit_code |
if __name__ == '__main__': |