unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: amirouche <amirouche@hypermove.net>
To: Guile User <guile-user@gnu.org>
Subject: Help me setup test coverage
Date: Tue, 06 Mar 2018 20:07:54 +0100	[thread overview]
Message-ID: <1520363274.2996.0@mail.gandi.net> (raw)

Hello all!


I have some difficulties setting up test coverage.

Here the procedure I use that inspired from guile/test-suite/guile-test:


(use-modules (system vm coverage)
             (system vm vm))


(define (run-test-with-coverage test)
  (call-with-values (lambda ()
                      (with-code-coverage
                       (lambda ()
                         (load test))))
    (lambda (data result)
      (let ((port (open-output-file (string-append test ".info"))))
        (coverage-data->lcov data port)
        (close port)))))

(run-test-with-coverage (cadr (program-arguments)))


It takes the name of a module as first argument and will load that file
inside 'with-code-coverage' and write the lcov .info file.

I've setup a simple example, it requires guile and lcov for genhtml.

You can reproduce the issue as follow:

  $ git clone https://github.com/a-guile-mind/coverage
  $ cd coverage
  $ make
    test echo
    Overall coverage rate:
      lines......: 0.0% (0 of 9164 lines)
      functions..: no data found

As you can see in the output, no lines seems to be visited by the vm.
The output should be at least one, the line inside test.scm.

What I am doing wrong?

Thanks in advance!






             reply	other threads:[~2018-03-06 19:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06 19:07 amirouche [this message]
2018-03-12 14:55 ` Help me setup test coverage Ludovic Courtès
2018-03-12 22:40   ` amirouche
2018-03-13 10:54     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1520363274.2996.0@mail.gandi.net \
    --to=amirouche@hypermove.net \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).