You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Cairo coverage, we use compilator mappings in the form of: Sierra ID -> list of details, where each detail is a triple consisting of:
Path to file
Line in file
Function name
We want to focus on the coverage of functions that belong to the user project. However, the user should also have the option to filter out test functions in their project, as these might disturb the true line coverage statistics.
Sierra JSON Files
The structure of the *.sierra.json files is as follows:
In the debug_info.executables.snforge_internal_test_executable section, entries point to functions marked with #[test]. Thanks to this, we know the debug names of the functions marked with #[test].
High-level Algorithm
Extract function names marked with #[test] from the *.sierra.json files.
Analyze entries of Sierra ID -> list of [(path to file, line in file, function name)].
Check if the function_name is not in the list of test functions.
Filter out entries that do not meet these criteria.
This will not work on functions in #[cfg(test)] that are not marked #[test] this should be fixed here .
The text was updated successfully, but these errors were encountered:
ksew1
changed the title
Filter out fille locations that are not in user project and in /tests dir
Filter out /tests file locations and file locations not from user project
Aug 26, 2024
In Cairo coverage, we use compilator mappings in the form of: Sierra ID -> list of details, where each detail is a triple consisting of:
We want to focus on the coverage of functions that belong to the user project. However, the user should also have the option to filter out test functions in their project, as these might disturb the true line coverage statistics.
Sierra JSON Files
The structure of the *.sierra.json files is as follows:
In the
debug_info.executables.snforge_internal_test_executable
section, entries point to functions marked with#[test]
. Thanks to this, we know the debug names of the functions marked with#[test]
.High-level Algorithm
#[test]
from the*.sierra.json
files.function_name
is not in the list of test functions.This will not work on functions in
#[cfg(test)]
that are not marked#[test]
this should be fixed here .The text was updated successfully, but these errors were encountered: