diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-03-28 15:46:49 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-03-28 15:46:49 (GMT) |
commit | f53a1ef582494458301b97bf6e546be52d7ff7e8 (patch) | |
tree | 7571b5cbcbd8a8f1dd1c966c9045b6cb69f0e295 /BuildTools/Coverage/FilterLCovData.py | |
parent | 638345680d72ca6acaf123f2c8c1c391f696e371 (diff) | |
download | swift-contrib-f53a1ef582494458301b97bf6e546be52d7ff7e8.zip swift-contrib-f53a1ef582494458301b97bf6e546be52d7ff7e8.tar.bz2 |
Moving submodule contents back.
Diffstat (limited to 'BuildTools/Coverage/FilterLCovData.py')
-rwxr-xr-x | BuildTools/Coverage/FilterLCovData.py | 32 |
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..a3a7ee5 --- /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 (file.find("/Swiften/") == -1 and file.find("/Slimber/") == -1 and file.find("/Swift/") == -1) or (file.find("/UnitTest/") != -1 or file.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() |