OpenCppCoverage icon indicating copy to clipboard operation
OpenCppCoverage copied to clipboard

Not able to generate the report, report has no data

Open prasanna532 opened this issue 6 years ago • 10 comments

Before creating an issue, please make sure the answer is not in the FAQ.

This template is applied for all bug requests. Remove it for other general question or feature request.

Describe your environment

  • Version of OpenCppCoverage: _____0.9.7.0
  • Architecture (x86/ x64): ___64
  • Windows version: _____ 10

Describe your problem

I am trying to do the POC for code coverage so that just i started with Winrar application...

But it is showing like below image image

and getting the below error [info] Coverage generated in Folder C:\Users\user\CoverageReport-2019-02-13-16h13m52s [info] ---------------------------------------------------- [warning] No modules were selected. Please check the values of --modules and --excluded_modules. You can try to remove all --modules and --excluded_modules and use --modules=C:\Windows\SysWOW64 instead.

prasanna532 avatar Feb 13 '19 13:02 prasanna532

Hello,

You need PDB files to compute code coverage and so it cannot work with WinRar.exe except if you compiled it. The PDB files are automatically generated by Visual Studio.

I have just added a new section Your first coverage which help you create a coverage report.

I hope it helps,

OpenCppCoverage

OpenCppCoverage avatar Feb 14 '19 20:02 OpenCppCoverage

I have all .pdb files... still .cov files for few projects are only 100 something bytes long and no coverage report is built for these projects.

michalfita avatar Feb 18 '19 15:02 michalfita

make sure you are building with the /DEBUG linker and the /Zi compiler flags.

I also noticed that if UNC is involved OpenCPPCoverage has problems to generate the code/modules mappings.

MarcoWagner avatar Feb 19 '19 09:02 MarcoWagner

@michalfita : Can you post the log with --verbose flag ?

OpenCppCoverage avatar Jun 17 '19 14:06 OpenCppCoverage

@prasanna532 请问你的问题解决了吗?我目前也遇到了同样的问题,想请教是怎么解决的。

mengfei227 avatar Nov 08 '19 08:11 mengfei227

Is your problem solved? I am currently experiencing the same problem and I would like to ask how to solve it.

Are you building on the same machine as you are running the code with cppcoverage attached?

When building on a different machine i had to create a mapping from the original to the differen source location like: --substitute_pdb_source_path %ORIGINAL_PATH%?%CURRENT_PATH% (? acts as a delim between the two specified paths) and --sources %CURRENT_PATH%

ORIGINAL_PATH is set to the absolute root-path of the folder structure as its located at build time and CURRENT_PATH is set to the absolute root-path where the actual running binarys are located. The directory layout is, except the beginning which is specified in this mapping, identical.

In this situations i had problems using UNC (\<sharename>) and had to assign a network drive-letter (but i think this got solved in the meantime).

MarcoWagner avatar Nov 08 '19 08:11 MarcoWagner

@prasanna532 是在同一台计算机上构建的。opencppcoverage原本是vs的一种插件,目前在vs中使用是正常的,但是在cmd或者是powershell中使用opnecppcoverage却出现No modules were selected. Please check the values of --modules and --excluded_modules.这样的情况

mengfei227 avatar Nov 11 '19 01:11 mengfei227

@prasanna532 @mengfei227 : Please see Coverage report is empty. It helps identifying the issue.

OpenCppCoverage avatar Nov 30 '19 08:11 OpenCppCoverage

Hi, I have this issue too. I'm working with VS Code 2019 on Parallels, because I have a Mac. Nothing from here helped me.

donpaul999 avatar Apr 11 '20 18:04 donpaul999

Hi @donpaul999:

  1. Did you try running OpenCppCoverage without --modules, --excluded_modules, --sources and --excluded_sources?
  2. Did you run OpenCppCoverage with --verbose and checked if LastCoverageResults.log file contained either [debug] Module: XXXXX.dll is skipped because it matches no selected patterns or [info] Module: XXXX.dll is selected because it matches selected pattern?
  3. Did you set a breakpoint in your code and tried to reach it when running your program under a debugger?

OpenCppCoverage

OpenCppCoverage avatar Apr 13 '20 17:04 OpenCppCoverage