When the compile flag used by COVER and CT are different.
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, execute the tests again, and export/import coverages.
void testFunction(){
int a;
int b;
//In the case of adding CT_FLAG macro in CT and not adding it in COVER, or vice versa.
#ifdef CT_FLAG
callFunction();
#endif
}
When differently calculate the bodyhash of the same funcion.
Importing coverage may fail if the bodyhash value of the same function is differently calculated in COVER and CT In this case, add EXCLUDE_BODYHASH_CVG_IMPORT=true
option to ut.ini
file, so that you can import coverage even if the bodyhash values are different.
ut.ini
path :project_path\.csdata\ut.ini
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 with the following steps.
- Check if the source file name exported from the cover and the name to be imported in the CT are the same.
- If the names are different, make them the same by changing the source file name in CT or COVER.
- Proceed with the coverage import.
Need more help with this?
Don’t hesitate to contact us here.