guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help me setup test coverage


From: amirouche
Subject: Help me setup test coverage
Date: Tue, 06 Mar 2018 20:07:54 +0100

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 via email to

[Prev in Thread] Current Thread [Next in Thread]