项目作者: samcv

项目描述 :
MoarVM line/file based coverage reporting
高级语言: Shell
项目地址: git://github.com/samcv/MoarVM-cover.git
创建时间: 2017-03-30T22:11:12Z
项目社区:https://github.com/samcv/MoarVM-cover

开源协议:

下载


MoarVM line based/function 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.

Instructions

Dependencies

  • llvm-cov and clang (hard dependency)
    • If you already have clang, you probably already have llvm-cov
  • ansi2html (soft dependency)
    • For the line based reporting, llvm-cov natively can output as html. But for
      the file and function based coverage reporting, we use ansi2html to convert
      the color output of llvm-cov to html.
    • If you don’t have it, it will generate the line based coverage and just not
      create the function based and file based one.

Info

  • report-libmoar.html details stats of files
    that are included in the libmoar.so, which is to the best of my knowledege, everything but main.c
  • report-moar.html details of moar binary, which
    is only main.c (so most files show no coverage except this one)

Generating it yourself

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).

  1. $ ls
  2. MoarVM
  3. MoarVM-cover
  4. 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).

  • Run:
    1. cd nqp
    2. # Make sure you are in the nqp repo directory then run:
    3. ln -s ../MoarVM-cover/nqp-profile
    4. ln -s ../MoarVM-cover/merge-profraw.sh
    5. cd ../MoarVM
    6. ln -s ../MoarVM-cover/html-cover.sh
    Now you are ready to run the fully automated super awesome html-cover.sh script!
    1. ./html-cover.sh
    This will generate line by line html coverage report as well as stats for each function.
    It will generate into the html directory of MoarVM

    coverage