0

I'm trying to generate code coverage using gcov.

When I'm compiling (with --coverage flag) on linux, I have no problems, but when I'm trying the same thing on windows, no .gcno files are generated... I have no errors, just nothing is generated.

I have absolutely no clue on what's happening and what do I need to do to generate those files.

Edit: It's a Qt project, we're using .pro to generate Makefiles. We're using MSVC 14.16.27023 to compile the project.

Some help would be really appreciated, I'm loosing my (few remaining) hairs on this one...

Edit2: Defined flags in one of the the makefiles :

CXXFLAGS = -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus /W3 --coverage -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\xxxxxxx.vc.pdb $(DEFINES)

LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT --coverage /DEBUG /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"

5
  • Showing makefile or equivalent might be useful. Also which compiler/environment on windows do you use?
    – Jarod42
    Sep 10, 2021 at 9:56
  • I edited my post with the compiler. However, I'm not allowed to show any code/scripts/makefiles from the project... But the --coverage flag is present on the compilation lines, but nothing happend... Sep 10, 2021 at 11:49
  • 1
    Create a minimal one from scratch. In the process, you might even find the issue/fix by yourself.
    – Jarod42
    Sep 10, 2021 at 11:51
  • I don't use WIndows nor MSVC and am just surprised that MSVC should be using gcov, which is a GNU utility, and that the CLI option to use it is of the same format that for gcc, --coverage. Are you perfectly sure this is OK?
    – zkoza
    Sep 16, 2021 at 14:08
  • Here they write VS has an /EnableCodeCoverage command-line option, learn.microsoft.com/en-us/visualstudio/test/… Have you tried this?
    – zkoza
    Sep 16, 2021 at 14:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.