summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tools/coverage/FilterLCovData.py')
-rwxr-xr-xtools/coverage/FilterLCovData.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/coverage/FilterLCovData.py b/tools/coverage/FilterLCovData.py
index 8b8d24e..8d56a7f 100755
--- a/tools/coverage/FilterLCovData.py
+++ b/tools/coverage/FilterLCovData.py
@@ -1,9 +1,15 @@
#!/usr/bin/env python
-import sys, re
+# TODO: Add uncovered non-ignored files
+
+import sys, re, os.path
assert(len(sys.argv) == 2)
+def isIgnored(file) :
+ return (find.find("/Swiften/") == -1 and find.find("/Slimber/") == -1 and find.find("/Swift/") == -1) or (find.find("/UnitTest/") != -1 or find.find("/QA/") != -1)
+
+
output = []
inputFile = open(sys.argv[1])
inIgnoredFile = False
@@ -12,11 +18,12 @@ for line in inputFile.readlines() :
if line == "end_of_record\n" :
inIgnoredFile = False
else :
- if line.startswith("SF:") and (line.find("/Swiften/") == -1 or line.find("/UnitTest/") != -1 or line.find("/QA/") != -1 or line.find("/3rdParty/") != -1):
+ if line.startswith("SF:") and isIgnored(line) :
inIgnoredFile = True
else :
- if line.startswith("SF:") :
- line = line.replace("/./Swiften/", "/Swiften/")
+ m = re.match("SF:(.*)", line)
+ if m :
+ line = "SF:" + os.path.realpath(m.group(1)) + "\n"
output.append(line)
inputFile.close()