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

Support ignoring coverage for concrete expressions. #26

Open nadako opened 10 years ago

nadako commented 10 years ago

We use a build macro for some of our classes, that inject some runtime checking expressions into a class method.

We test all expressions that can be generated by that macro in a separate test and would like these expressions to be ignored by MCover in all other classes.

It would be nice if MCover could ignore coverage at expression level by checking expression metadata. Then our build macro can add that meta for its expressions to make sure they are ignored.

nadako commented 10 years ago

Actually, I've found that massivecover already ignores EMeta expressions, so it can be a bug, because not all expressions with metadata should be ignored.

misprintt commented 10 years ago

I've added support for EMeta (and ignoring individual expressions) in the feature/v3 branch.

I haven't added it to master (2.x) because 3.0 includes a lot of refactoring of the internal macros including the class that traverses the expression tree.

If you need it immediately, then you could create a fork of master, and add the equivalent of (https://github.com/massiveinteractive/MassiveCover/blob/feature/v3/src/mcover/macro/BuildMacro.hx#L208) to the old class https://github.com/massiveinteractive/MassiveCover/blob/master/src/mcover/coverage/macro/CoverageExpressionParser.hx#L118

FYI - feature/v3 is backwards compatible (other than the removal of haxe 2.x support and the removal of the unused mcover.logger tools)

nadako commented 10 years ago

Thanks, I will check it out. Any estimates on new release?