0

I have a query . Is there any way I can validate that the .c file has a corresponding .gcno and .gcda file generated. For example :

I have a sample.c file.Now I generate the .gcno and .gcda files. Again modify the sample.c file but I did not generate the latest gcda and gcno files for the modified .c file. Is ther any way I can validate if the sample.c has a correspodning .gcno and gcda files genearted?

scot ggh
  • 5
  • 2

1 Answers1

0

There is no specific way of doing it but the usual convention that people follow is to store the coverage data once the execution is done into a file relevantly named to execution and then remove only ".gcda" files.

This enables you to perform a different execution and generate coverage without recompiling everything.

In your case you can simply search for relevant ".gcno" file and remove that too, so that you can recompile after modification.Even if you don't delete gcno it will be over written unlike in the case of ".gcda" files which get appended.

One more thing you need to know is: if you try to generate coverage data from gcda & gcno files by gcov then it will give you a prompt saying the xyz source file is newer than the corresponding gcno file.

Vikas Tawniya
  • 1,323
  • 1
  • 13
  • 22