BullseyeCoverage Up Contents Search

Measurements Show 0% Coverage

SYMPTOM

After instrumenting and running your test program, BullseyeCoverage shows information for all project source code but the coverage measurements shown for one or more functions are unexpectedly 0%.

CAUSE

Possible causes of this problem:

  1. The instrumented test program was never run. An uninstrumented copy of your test program might have been run.

  2. The BullseyeCoverage run-time encountered an error when attempting to save coverage.

  3. Coverage measurements were updated to a different coverage file than the one used to generate the report.

  4. The test program ended abnormally before BullseyeCoverage saved any measurements.

  5. The Windows API LoadLibraryEx was used with the DONT_RESOLVE_DLL_REFERENCES flag, or an executable module (.exe) was loaded with LoadLibrary or LoadLibraryEx.

RESOLUTION

  1. Verify whether the test program and shared libraries are instrumented. You can do this by searching the executables for the string BullseyeCoverage, like shown below.
    $ strings calc1.exe | grep "^BullseyeCoverage "
    BullseyeCoverage 8.19.0     ← product version
    BullseyeCoverage 8.11.1     ← file format version
    

    On Windows, the strings and grep commands can be found in Cygwin or MSYS2 .

  2. Check for run-time errors. The BullseyeCoverage run-time writes errors to the file named by environment variable COVERR, if set.

    If COVERR is not set, errors are written to standard error with Windows console programs and Unix-like systems. With Windows GUI programs, errors are written to %USERPROFILE%\BullseyeCoverageError.txt.

    If you find a BullseyeCoverage run-time error occurred, see Run-Time Errors for a description and resolution.

  3. Check the COVFILE environment variable setting to make sure it names the same coverage file with which you built and instrumented the test program.

  4. Explicitly examine the BullseyeCoverage run-time error status. This is a brute-force diagnostic method that provides valuable information.

    Add a call to cov_write to your program at a point you believe is executed. For embedded systems or test programs that use the small footprint run-time configuration, call cov_dumpData instead. Display the return code status and look it up at Run-Time Errors.

  5. Do not use DONT_RESOLVE_DLL_REFERENCES. Do not load an executable module (.exe) with LoadLibrary or LoadLibraryEx.

MORE INFORMATION

The coverage file does not grow in size with new coverage. To determine whether the coverage file has been updated, view a coverage report.

Updated: 16 Jan 2024