Last active
April 23, 2020 20:46
-
-
Save JekoTronik/6401d0a60a3e4e8829210e70583d0254 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-modules (system vm coverage) | |
(system vm vm)) | |
(add-to-load-path (dirname (current-filename))) | |
(call-with-values (lambda () | |
(with-code-coverage (lambda () | |
(load "tests.scm")))) | |
(lambda (tests-coverage-data . useless-values) | |
(call-with-output-file "lcov.info" | |
(lambda (lcov-file) | |
(coverage-data->lcov tests-coverage-data lcov-file))))) | |
;; Focus coverage on my module | |
(when (not (zero? (system* "lcov" "--remove" "lcov.info" "-o" "lcov-final.info" "/gnu/*"))) | |
(error "lcov remove failed")) | |
(when (not (zero? (system* "genhtml" "lcov-final.info" "-o" "coverage"))) | |
(error "genhtml failed")) | |
(delete-file "lcov.info") | |
(delete-file "lcov-final.info") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment