diff --git a/run.py b/run.py index c638bf4..56d61c2 100644 --- a/run.py +++ b/run.py @@ -73,9 +73,13 @@ class coverage_info(list): list.__init__(self) xmldoc = xml.dom.minidom.parse(xml_filename) itemlist = xmldoc.getElementsByTagName('package') + if module_basepath is None: + offset_mod_path = 0 + else: + offset_mod_path = len(module_basepath) + 1 for p in itemlist: module = {} - module[jsonlog.COVI_KEY_NAME] = p.attributes['name'].value[len(module_basepath) + 1:] + module[jsonlog.COVI_KEY_NAME] = p.attributes['name'].value[offset_mod_path:] module[jsonlog.COVI_KEY_FILEPATH] = p.attributes['name'].value.replace('.', os.path.sep) module[jsonlog.COVI_KEY_LINE_COVERAGE] = float(p.attributes['line-rate'].value) * 100. try: @@ -85,7 +89,7 @@ class coverage_info(list): module[jsonlog.COVI_KEY_FILES] = [] for c in p.getElementsByTagName('class'): f = {} - f[jsonlog.COVI_KEY_NAME] = c.attributes['filename'].value[len(module_basepath) + 1:].replace(os.path.sep, '.') + f[jsonlog.COVI_KEY_NAME] = c.attributes['filename'].value[offset_mod_path:].replace(os.path.sep, '.') f[jsonlog.COVI_KEY_FILEPATH] = c.attributes['filename'].value f[jsonlog.COVI_KEY_LINE_COVERAGE] = float(c.attributes['line-rate'].value) * 100. try: diff --git a/templates/unittest_head.tex b/templates/unittest_head.tex index d3f3327..c911c4c 100644 --- a/templates/unittest_head.tex +++ b/templates/unittest_head.tex @@ -42,6 +42,7 @@ {ä}{ {\"a} }1 {ö}{ {\"o} }1 {~}{ {\textasciitilde} }1 + {°}{ {\textdegree} }1 } \usepackage{color} \definecolor{bg-partially-covered}{rgb}{1,1,0.6} % light-yellow