summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-08-14 09:13:11 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-08-16 22:13:28 (GMT)
commitd3dad1ccfe1741a5a5f2c610d995b5c8cc603844 (patch)
treeee78712720803addda4a7c3f2e1bc50b402c8257 /BuildTools/Coverage/FilterLCovData.py
parent8e53a2df443901f786932942759e5fe7b632852e (diff)
downloadswift-d3dad1ccfe1741a5a5f2c610d995b5c8cc603844.zip
swift-d3dad1ccfe1741a5a5f2c610d995b5c8cc603844.tar.bz2
Move coverage tools to BuildTools dir.
Diffstat (limited to 'BuildTools/Coverage/FilterLCovData.py')
-rwxr-xr-xBuildTools/Coverage/FilterLCovData.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/BuildTools/Coverage/FilterLCovData.py b/BuildTools/Coverage/FilterLCovData.py
new file mode 100755
index 0000000..8d56a7f
--- /dev/null
+++ b/BuildTools/Coverage/FilterLCovData.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+# 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
+for line in inputFile.readlines() :
+ if inIgnoredFile :
+ if line == "end_of_record\n" :
+ inIgnoredFile = False
+ else :
+ if line.startswith("SF:") and isIgnored(line) :
+ inIgnoredFile = True
+ else :
+ m = re.match("SF:(.*)", line)
+ if m :
+ line = "SF:" + os.path.realpath(m.group(1)) + "\n"
+ output.append(line)
+inputFile.close()
+
+outputFile = open(sys.argv[1], 'w')
+outputFile.write(''.join(output))
+outputFile.close()