diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-08-05 11:06:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-08-05 11:06:41 -0400 |
commit | ebff18d18eb5fa93a82b19af95c65a36fd3a841d (patch) | |
tree | 99a58ae489fb622c53ab905af5f776a59baac19d /scripts | |
parent | 1d63ecbed0c8416eeed9d1f278422dc1edbea8ad (diff) | |
download | tor-ebff18d18eb5fa93a82b19af95c65a36fd3a841d.tar.gz tor-ebff18d18eb5fa93a82b19af95c65a36fd3a841d.zip |
Allow cov-display to take directories as arguments
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/test/cov-display | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/test/cov-display b/scripts/test/cov-display index 6c3bbd5511..4628cd589b 100755 --- a/scripts/test/cov-display +++ b/scripts/test/cov-display @@ -1,5 +1,5 @@ #!/usr/bin/python -import sys, re +import sys, re, os none0, some0 = 0,0 branchTaken0, branchNot0 = 0,0 @@ -20,7 +20,16 @@ def show(name, none, some): none = 1 print name, none, some, "%.02f"%(100*(float(some)/(some+none))) -for fn in sys.argv[1:]: + +file_args = sys.argv[1:] +files = [] +for fn in file_args: + if os.path.isdir(fn): + files.extend(os.path.join(fn, f) for f in os.listdir(fn)) + else: + files.append(fn) + +for fn in files: none = some = branchTaken = branchNot = 0 inFunc = "" for line in open(fn, 'r'): |