When fail to import coverages of COVER
- Check that the compile flags used in COVER and CT 2024.06 are the same.
- The preprocessed files are used to measure coverages. Different compile flags may result in different preporcessed files.
- In this case, set the compile flags of COVER and CT identically.
- Then, execute the tests so that coverage can be measured by COVER.
- After exporting the coverage data from COVER, perform the import coverage function in CT to bring in the coverage data from COVER.
- The preprocessed files are used to measure coverages. Different compile flags may result in different preporcessed files.
void testFunction(){
int a;
int b;
//In the case of adding CT_FLAG macro in CT 2024.06 and not adding it in COVER, or vice versa.
#ifdef CT_FLAG
callFunction();
#endif
}
- Check that the bodyhash of the same function in both COVER and CT 2024.06 is identical.
- Importing coverage may fail if the bodyhash value of the same function is differently calculated in COVER and CT 2024.06. In this case, add
EXCLUDE_BODYHASH_CVG_IMPORT=true
option tout.ini
file, so that you can import coverage even if the bodyhash values are different.ut.ini
path :project_path\.csdata\ut.ini
- Importing coverage may fail if the bodyhash value of the same function is differently calculated in COVER and CT 2024.06. In this case, add
In case of being unable to retrieve “function and coverage information” included in a specific source file.
While importing coverage, there are cases where you cannot get all the “function and coverage information” included in a particular source file, along with an error message that says “Failed to get coverage information for some functions.” In this case, the issue can be resolved by checking the following two items.
- Check if the source file name exported from the cover and the name to be imported in the CT 2024.06 are the same.
- If the names are different, make them the same by changing the source file name in CT 2024.06 or COVER.
- Proceed with the coverage import.
- Check if the source files to be imported contain files with the .C extension.
- Modify the source file extension.
- Rename .C files to .c, then reanalyze.
- Proceed with the coverage import.
- Modify the [Source File Extensions] settings in CT 2024.06.
- Go to [Project Properties] -> [Source File Types] -> [C/C++ File List], remove *.C, and reanalyze.
- Proceed with the coverage import.
- Modify the source file extension.
After importing the coverage of COVER, when the coverage values are different
If the coverage displayed on COVER and CT 2024.06 differs after obtaining coverage, the following should be considered:
- When the denominators of coverage are different
- If the denominators differ, check the denominators for each file to identify the targets where the coverage differs.
- If the coverage measurement targets of COVER and CT 2024.06 are different, exclude the non-target functions from measurement to align the denominators.
- When the denominators are the same but the coverage results differ
- If the denominators are the same but the coverage results differ, it means that certain functions’ coverage has not been imported.
- Collect the coverage file (.csd) and project log files, and contact the contact details at the bottom of the manual’s [Troubleshooting] page for technical support.
Need more help with this?
Don’t hesitate to contact us here.