aboutsummaryrefslogtreecommitdiff
path: root/trim-lcov.py
diff options
context:
space:
mode:
authorRodney Dawes <rodney.dawes@canonical.com>2017-02-02 15:52:03 -0500
committerRobert Tari <robert@tari.in>2021-07-09 01:12:23 +0200
commit76789a3a3bd92c08e694b6d05020d20b49bff50f (patch)
treed77d36be2846f26e52370dcd215c90a2c7482233 /trim-lcov.py
parent612ded78ec1762d9b71af6d5bba56eb415e1039e (diff)
downloadayatana-indicator-datetime-76789a3a3bd92c08e694b6d05020d20b49bff50f.tar.gz
ayatana-indicator-datetime-76789a3a3bd92c08e694b6d05020d20b49bff50f.tar.bz2
ayatana-indicator-datetime-76789a3a3bd92c08e694b6d05020d20b49bff50f.zip
Use cmake-extras for coverage support and always enable testing.
Diffstat (limited to 'trim-lcov.py')
-rwxr-xr-xtrim-lcov.py57
1 files changed, 0 insertions, 57 deletions
diff --git a/trim-lcov.py b/trim-lcov.py
deleted file mode 100755
index 2cd8dee..0000000
--- a/trim-lcov.py
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-# This script removes branch and/or line coverage data for lines that
-# contain a particular substring.
-#
-# In the interest of "fairness" it removes all branch or coverage data
-# when a match is found -- not just negative data. It is therefore
-# likely that running this script will actually reduce the total number
-# of lines and branches that are marked as covered (in absolute terms).
-#
-# This script intentionally avoids checking for errors. Any exceptions
-# will trigger make to fail.
-#
-# Author: Ryan Lortie <desrt@desrt.ca>
-
-import sys
-
-line_suppress = ['g_assert_not_reached']
-branch_suppress = ['g_assert', 'g_return_if_fail', 'g_clear_object', 'g_clear_pointer', 'g_return_val_if_fail', 'G_DEFINE_TYPE']
-
-def check_suppress(suppressions, source, data):
- line, _, rest = data.partition(',')
- line = int(line) - 1
-
- assert line < len(source)
-
- for suppression in suppressions:
- if suppression in source[line]:
- return True
-
- return False
-
-source = []
-for line in sys.stdin:
- line = line[:-1]
-
- keyword, _, rest = line.partition(':')
-
- # Source file
- if keyword == 'SF':
-
- with open(rest, 'r') as pFile:
-
- source = pFile.readlines()
-
- # Branch coverage data
- elif keyword == 'BRDA':
- if check_suppress(branch_suppress, source, rest):
- continue
-
- # Line coverage data
- elif keyword == 'DA':
- if check_suppress(line_suppress, source, rest):
- continue
-
- print(line)