massive-oss / mcover

A cross platform code coverage framework for Haxe with testing and profiling applications. Supports AVM1, AVM2, JavaScript, C++, PHP and Neko.
Other
59 stars 9 forks source link

Always reporting 0% on cpp target #31

Closed ubald closed 9 years ago

ubald commented 10 years ago

I am using a CPP target with the latest haxe version, munit and mcover form haxelib, I set up everything like the doc says and the coverage always shows 0% event if I know I am testing code from the package specified in mcover's config.

I can provide more info/sample code in case it is not a known bug or something easily reproducible on your side.

ubald commented 10 years ago

Actually after more testing I realized that only certain classes or packages are "randomly" covered but not all.

ubald commented 10 years ago

Isolated the issue down to

Compiler.keep(cls, false, true);//ignored in haxe 2_0_8

On line 170 (approx, I may have removed some blank lines) of MCover.hx

If I comment it out it runs correctly.

misprintt commented 9 years ago

Apologies for the slow response - we have seen the issue effecting random packages as well.

Looks like something in Haxe 3.1 changed the underlying behavior of Compiler.keep. It is concerning that it includes/ignores packages inconsistently/

As far as i can tell this line is now redundant, so it can be wrapped it in a conditional flag for haxever < 3.1.