简体   繁体   中英

bullseye coverage, code coverage is 0%

I am very new to Code Coverage and the tools that I am using currently. I was using the bullseye coverage to evaluate the code coverage for a simple "hello world" code. After compiling the code, I tried to open the .cov file and it shows 0% code coverage? The commands that I have used are 1) set COVFILE=c:.......\\test.cov 2) gcc -c main.c 3) covc gcc -c main.c

After writing these commands, I can see the test.cov file being generated but the coverage browser shows 0% code coverage. Am I missing out something ? I mean the main.c has only main() and it is not getting called? How come?

It seems that you haven't run the binary. You have set the COVFILE env variable, compiled your code using Bullseye gcc wrapper compiler.

Now you should run your compiled code, and only then you will see the coverage raising.

确保使用以下标志编译应用程序:

-fprofile-arcs -ftest-coverage

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM