summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Bartell <pbartell@amazon.com>2021-03-19 17:53:29 -0700
committerPaul Bartell <paul.bartell@gmail.com>2021-03-22 14:58:52 -0700
commit3a48781a03175bbc9afa22c686bb00826ac13eb5 (patch)
tree1951b464ac1042e6ec8af257965d7c45c23e611b
parent26478d721f87d4c78bb86bc2733fe6488f4fbb58 (diff)
downloadfreertos-git-3a48781a03175bbc9afa22c686bb00826ac13eb5.tar.gz
Skip filtering of coverage if no @coverage tags are found in a _utest.c file
-rwxr-xr-xFreeRTOS/Test/CMock/tools/filtercov.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/FreeRTOS/Test/CMock/tools/filtercov.py b/FreeRTOS/Test/CMock/tools/filtercov.py
index 3b1fc120f..35a58c16e 100755
--- a/FreeRTOS/Test/CMock/tools/filtercov.py
+++ b/FreeRTOS/Test/CMock/tools/filtercov.py
@@ -79,10 +79,12 @@ def main():
print("The test file path does not exist.", file=sys.stderr)
sys.exit(1)
+ skip_target_filtering = False
tagged_functions = get_tagged_functions_in_file(args.test)
if len(tagged_functions) == 0:
- print("No target functions found in test file.")
- sys.exit(1)
+ print("WARNING: No target functions found in test file.")
+ skip_target_filtering = True
+
print("Target functions from UT: " + str(tagged_functions), file=sys.stderr)
cov_functions_deps = get_function_deps(args.map, tagged_functions)
@@ -94,7 +96,13 @@ def main():
covfile_handle = gzip.open(vars(args)["in"], "rb")
else:
covfile_handle = open(vars(args)["in"], "r")
- covdata_out = filter_coverage_file(covfile_handle, cov_functions_deps)
+
+ if skip_target_filtering:
+ print("WARNING: Skipping coverage filtering.")
+ covdata_out = json.load(covfile_handle)
+ else:
+ covdata_out = filter_coverage_file(covfile_handle, cov_functions_deps)
+
covfile_handle.close()
filter_excluded_lines(covdata_out)