Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coverage tests for Raku modules?

Apparently, there are no coverage test modules in the ecosystem, and the only reference to something similar is the coverage tests in CommaIDE, which unfortunately are not present in the community (free) edition. There seems to be some coverage at a lower level, MoarVM, but I don't see any way to do this easily in Raku modules. Is there maybe some simple language support for this?

like image 221
jjmerelo Avatar asked Nov 06 '19 12:11

jjmerelo


1 Answers

The Comma IDE makes use of the MoarVM coverage output, which it parses, aggregates, and presents (using its model of the source code to figure out statement extents and which statements are coverable in order to generate the statistics).

The only other thing I'm aware of that currently exists to parse this output is this script. The MoarVM coverage support was originally developed in order to understand specification test coverage of the core built-ins, and the script makes a report of those. However, the mechanism that was put into MoarVM is actually more general, and so can be used to get the raw coverage data for any program. To my knowledge, however, the script I linked and Comma are the only tools built so far that analyze it.

like image 101
Jonathan Worthington Avatar answered Nov 03 '22 06:11

Jonathan Worthington