When fail to import coverages of COVER

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.

After importing the coverage of COVER, when the coverage values are different

If the coverage displayed on COVER and CT differs after obtaining coverage, the following should be considered:

  1. 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 are different, exclude the non-target functions from measurement to align the denominators.
  1. 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 [Technical Support] page for technical support.

Need more help with this?
Don’t hesitate to contact us here.

Thanks for your feedback.