BullseyeCoverage Up Contents Search

cov_file - Set Coverage File Path

int cov_file(const char* path);

Description

Function cov_file sets the path of the coverage file, for the current executable image. This setting overrides environment variables COVFILE and COVFILELIST.

You must call this function before BullseyeCoverage writes to the coverage file the first time. The path cannot change after the file is written. By default, the auto-save thread writes to the file approximately one second after program startup.

This function is automatically declared in source files compiled by covc. In other source files, declare it by including <BullseyeCoverage.h>.

This function is not available with the embedded system small footprint run-time configuration.

Return Value

If successful, cov_file returns non-zero.

Examples

int main() {
	#if _BullseyeCoverage
		cov_file("file.cov");
	#endif
	...
}

Notes

Each DLL or shared library is considered a separate executable image. Calling this function from inside a DLL only affects the coverage data in that DLL and does not affect coverage data in programs which call the DLL or other DLLs.

Updated: 26 Aug 2020