[Top][All Lists]

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

Code coverage

From: jeremy
Subject: Code coverage
Date: Fri, 12 Apr 2019 12:35:17 +0200
User-agent: Roundcube Webmail/1.3.8

Hello dear guilers !

I have implemented a code coverage test with a piece of code I modified for my usage, here it is (filename : cybo-cov.scm):

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

(let ((output-directory
        (getenv "HOME") "/Workspace/guile-cybo/coverage")))
  (let-values (((data . values)
                (with-code-coverage (the-vm)
                                    (lambda ()
                                      (load "cybo-test.scm")))))
    (let* ((port (mkstemp! (string-copy "/tmp/cybo-coverage-XXXXXX")))
           (file (port-filename port)))
      (coverage-data->lcov data port)
      (close port)
      (when (not (zero? (system* "genhtml" file "-o" output-directory)))
            (error "genhtml failed"))
      (delete-file file))))

When I execute

$ guile -L .


scheme@(guile-user)> (load "cybo-cov.scm")

The report seems to cover my project and all Guile 2.0 code. I would like the test to focus on my project only.
Does someone know how I can configure the test ?

Thank you in advance for your help.


reply via email to

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