summaryrefslogtreecommitdiff
path: root/tests/pdtest
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2014-06-24 15:49:05 +0200
committerBert Vermeulen <bert@biot.com>2014-06-24 15:49:05 +0200
commitd45058e87e7045fef1b7c4425de1917a554545f7 (patch)
tree4f495a21b94651d4b285f314a37d71dad5c30851 /tests/pdtest
parentd2bdb1303679b97c3de5ce2d2d1f2b62c9828a3a (diff)
downloadlibsigrokdecode-d45058e87e7045fef1b7c4425de1917a554545f7.tar.gz
libsigrokdecode-d45058e87e7045fef1b7c4425de1917a554545f7.zip
pdtest: Generate a report listing missed lines across the whole PD.
Diffstat (limited to 'tests/pdtest')
-rwxr-xr-xtests/pdtest15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/pdtest b/tests/pdtest
index 088ad91..9309fb9 100755
--- a/tests/pdtest
+++ b/tests/pdtest
@@ -417,6 +417,21 @@ def run_tests(tests, fix=False):
if VERBOSE:
dots = '.' * (54 - len(pd) - 2)
INFO("%s total %s %d%%" % (pd, dots, pd_coverage))
+ if report_dir:
+ # generate a missing lines list across all the files in
+ # the PD
+ files = {}
+ for entry in missed_lines:
+ filename, line = entry.split(':')
+ if filename not in files:
+ files[filename] = []
+ files[filename].append(line)
+ text = ''
+ for filename in sorted(files.keys()):
+ line_list = ','.join(sorted(files[filename], key=int))
+ text += "%s: %s\n" % (filename, line_list)
+ open(os.path.join(report_dir, pd + "_total"), 'w').write(text)
+
return results, errors