mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-09 05:05:17 -05:00
Skip filtering of coverage if no @coverage tags are found in a _utest.c file
This commit is contained in:
parent
26478d721f
commit
3a48781a03
1 changed files with 11 additions and 3 deletions
|
|
@ -79,10 +79,12 @@ def main():
|
||||||
print("The test file path does not exist.", file=sys.stderr)
|
print("The test file path does not exist.", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
skip_target_filtering = False
|
||||||
tagged_functions = get_tagged_functions_in_file(args.test)
|
tagged_functions = get_tagged_functions_in_file(args.test)
|
||||||
if len(tagged_functions) == 0:
|
if len(tagged_functions) == 0:
|
||||||
print("No target functions found in test file.")
|
print("WARNING: No target functions found in test file.")
|
||||||
sys.exit(1)
|
skip_target_filtering = True
|
||||||
|
|
||||||
print("Target functions from UT: " + str(tagged_functions), file=sys.stderr)
|
print("Target functions from UT: " + str(tagged_functions), file=sys.stderr)
|
||||||
|
|
||||||
cov_functions_deps = get_function_deps(args.map, tagged_functions)
|
cov_functions_deps = get_function_deps(args.map, tagged_functions)
|
||||||
|
|
@ -94,7 +96,13 @@ def main():
|
||||||
covfile_handle = gzip.open(vars(args)["in"], "rb")
|
covfile_handle = gzip.open(vars(args)["in"], "rb")
|
||||||
else:
|
else:
|
||||||
covfile_handle = open(vars(args)["in"], "r")
|
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()
|
covfile_handle.close()
|
||||||
|
|
||||||
filter_excluded_lines(covdata_out)
|
filter_excluded_lines(covdata_out)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue