unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Help me setup test coverage
@ 2018-03-06 19:07 amirouche
  2018-03-12 14:55 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: amirouche @ 2018-03-06 19:07 UTC (permalink / raw)
  To: Guile User

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!






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-13 10:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-06 19:07 Help me setup test coverage amirouche
2018-03-12 14:55 ` Ludovic Courtès
2018-03-12 22:40   ` amirouche
2018-03-13 10:54     ` Ludovic Courtès

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