MoarVM line/file based coverage reporting
You can also go here to see the generated output from
the last time I have ran it, which reports on the NQP test suite coverage.
Unlike the other coverage reporter, which reports line based coverage
of Perl 6 itself, this reports coverage of the underlying Moar virtual machine.
It is planned to also automate coverage based reporting of the roast test suite
as well.
llvm-cov
and clang
(hard dependency)llvm-cov
ansi2html
(soft dependency)llvm-cov
natively can output as html. But foransi2html
to convertllvm-cov
to html.report-libmoar.html
details stats of fileslibmoar.so
, which is to the best of my knowledege, everything but main.c
report-moar.html
details of moar
binary, whichmain.c
(so most files show no coverage except this one)After reading the dependencies above, make sure your directory structure has
this repo, nqp MoarVM all on the same level. It is not strictly required for
MoarVM-cover to be on the same level as long as you adjust the ln -s
commands below, but the script does rely on nqp and MoarVM being on the same
level (also this is the only situation I am testing).
$ ls
MoarVM
MoarVM-cover
nqp
If you want to install MoarVM into a specific place, set the MOAR_PREFIX env variable,
otherwise it will build its own MoarVM in MoarVM/moar-cover
(may be a good idea if you don’t
want to disrupt your existing installation).
Now you are ready to run the fully automated super awesome html-cover.sh script!
cd nqp
# Make sure you are in the nqp repo directory then run:
ln -s ../MoarVM-cover/nqp-profile
ln -s ../MoarVM-cover/merge-profraw.sh
cd ../MoarVM
ln -s ../MoarVM-cover/html-cover.sh
This will generate line by line html coverage report as well as stats for each function.
./html-cover.sh