./coverage-report-dump.py \
--symcov coverage_data.symcov \
--srcpath root_src_dir \
- --dump dump-path
+ --dump dump-path \
+ --exclude-headers [path]
'''
with open(html_file, 'wb') as f:
f.write(response.encode('UTF-8', 'replace'))
- def do_Dump(self, symcov_data, src_path, dump_path):
+ def do_Dump(self, symcov_data, src_path, dump_path, exclude_headers=None):
filelist = []
self.__symcov_data = symcov_data
self.__src_path = src_path
if not os.path.exists(os.path.abspath(self.__dump_root)):
os.makedirs(self.__dump_root)
for filename in sorted(self.__symcov_data.filenames()):
+ if exclude_headers:
+ # ignore headers *.h/*.hpp
+ if filename.startswith(tuple(exclude_headers)) and\
+ filename.endswith((".h", ".hpp")):
+ continue
file_coverage = self.__symcov_data.file_coverage[filename]
if not file_coverage:
continue
parser = argparse.ArgumentParser(description="symcov report dump.")
parser.add_argument('--symcov', required=True, type=argparse.FileType('r'))
parser.add_argument('--srcpath', required=True)
+ parser.add_argument('--exclude-headers', nargs='?', const="",
+ default=None, required=False,
+ dest="ex_headers", action='append')
parser.add_argument('--dump', required=True,
help="Path to dump coverage")
args = parser.parse_args()
symcov_json = json.load(args.symcov)
Dumper = DumpCov()
- Dumper.do_Dump(SymcovData(symcov_json), args.srcpath, args.dump)
+ Dumper.do_Dump(SymcovData(symcov_json), args.srcpath,
+ args.dump, args.ex_headers)
if __name__ == '__main__':
main()