File: guile-coverage.scm

package info (click to toggle)
scheme-bytestructures 2.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 480 kB
  • sloc: lisp: 2,168; makefile: 73; sh: 8
file content (20 lines) | stat: -rwxr-xr-x 760 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
;;; Use this in the REPL.  It produces wrong results when ran as a script.

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

(let ((output-directory
       (string-append
        (getenv "HOME") "/srv/http/htdocs/lcov/scheme-bytestructures")))
  (let-values (((data . values)
                (with-code-coverage (the-vm)
                  (lambda ()
                    (load "run-tests.guile.scm")))))
    (let* ((port (mkstemp! (string-copy "/tmp/bytestructures-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))))