This project is read-only.

Skipping uncompiled code

Feb 23, 2016 at 1:05 PM

Sorry if the answer is obvious, but I coudn't find it.
Is there a way to remove from the stats the part of the code in a source file that is not compiled?
For ex, if you have compilation switches:
#ifdef FLAG
It is obvious that only one part will be exectuded (for a specific compilation). I wonder if the "dead" code can be removed from the stats.

Feb 24, 2016 at 5:57 PM

I have just run OpenCppCoverage on the following code.
#define TEST
#ifdef TEST
    void foo() {}
    void bar() {}

int main()
    return 0;
The function foo is marked as uncovered and the line for function bar is ignored as it should be.
Can you test this code with OpenCppCoverage in debug mode?

If you still have an issue, can you give me a source code that reproduce your issue and your Visual Studio version so that I can investigate?

Hope that help,

Marked as answer by OpenCppCoverage on 2/24/2016 at 10:36 AM
Feb 24, 2016 at 6:19 PM
Edited Mar 3, 2016 at 3:07 PM
OK thanks. I’m sorry my mistake. Works like a charm. Sorry for losing your time. Regards
Feb 24, 2016 at 6:36 PM

No problem, it was fast to answer.