diff options
Diffstat (limited to 'tools/coverage/FilterLCovData.py')
-rwxr-xr-x | tools/coverage/FilterLCovData.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/coverage/FilterLCovData.py b/tools/coverage/FilterLCovData.py new file mode 100755 index 0000000..b0d180f --- /dev/null +++ b/tools/coverage/FilterLCovData.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +import sys, re + +assert(len(sys.argv) == 2) + +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 (line.find("/Swift/") == -1 or line.find("/UnitTest/") != -1 or line.find("/QA/") != -1 or line.find("/3rdParty/") != -1): + inIgnoredFile = True + else : + output.append(line) +inputFile.close() + +outputFile = open(sys.argv[1], 'w') +outputFile.write(''.join(output)) +outputFile.close() |