[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 06/07: Add missing #:modules argument for coverage-data-
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] 06/07: Add missing #:modules argument for coverage-data->lcov. |
Date: |
Thu, 16 Jun 2022 04:06:51 -0400 (EDT) |
civodul pushed a commit to branch main
in repository guile.
commit 4456245753ff925cafd3e72d130761b6f1c2c419
Author: Jessica Tallon <tsyesika@tsyesika.se>
AuthorDate: Wed Apr 13 15:57:24 2022 +0200
Add missing #:modules argument for coverage-data->lcov.
The code coverage function `coverage-data->lcov` has a documented
`modules` argument, however that was missing from the source. I have
added it so when supplied it only converts the coverage data for the
supplied modules. If not supplied it defaults the old behavour of
including all the modules currently loaded.
* module/system/vm/coverage.scm (coverage-data->lcov): Add #:modules
parameter and honor it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
module/system/vm/coverage.scm | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/module/system/vm/coverage.scm b/module/system/vm/coverage.scm
index 0d51e261a..f1d65cc6c 100644
--- a/module/system/vm/coverage.scm
+++ b/module/system/vm/coverage.scm
@@ -300,7 +300,7 @@ was loaded at the time DATA was collected."
;;; LCOV output.
;;;
-(define* (coverage-data->lcov data port)
+(define* (coverage-data->lcov data port #:key (modules #f))
"Traverse code coverage information DATA, as obtained with
`with-code-coverage', and write coverage information in the LCOV format to
PORT.
The report will include all the modules loaded at the time coverage data was
@@ -325,6 +325,12 @@ gathered, even if their code was not executed."
;; Output per-file coverage data.
(format port "TN:~%")
+ (define source-files
+ (filter
+ (lambda (file)
+ (or (not modules) (member file modules)))
+ (instrumented-source-files data)))
+
(for-each (lambda (file)
(let ((path (search-path %load-path file)))
(if (string? path)
@@ -345,6 +351,6 @@ gathered, even if their code was not executed."
(format port "end_of_record~%"))
(begin
(format (current-error-port)
- "skipping unknown source file: ~a~%"
+ "skipping source file: ~a~%"
file)))))
- (instrumented-source-files data)))
+ source-files))
- [Guile-commits] branch main updated (cc4559768 -> 7e048c6c5), Ludovic Courtès, 2022/06/16
- [Guile-commits] 01/07: 'connect' handles EAGAIN like EINPROGRESS., Ludovic Courtès, 2022/06/16
- [Guile-commits] 02/07: 'module-define!' honors the 'module' parameter., Ludovic Courtès, 2022/06/16
- [Guile-commits] 05/07: Allow null bytes in UNIX sockets., Ludovic Courtès, 2022/06/16
- [Guile-commits] 06/07: Add missing #:modules argument for coverage-data->lcov.,
Ludovic Courtès <=
- [Guile-commits] 07/07: Update NEWS., Ludovic Courtès, 2022/06/16
- [Guile-commits] 03/07: Allow (library ...) form in cond-expand inside R7RS define-library., Ludovic Courtès, 2022/06/16
- [Guile-commits] 04/07: Allow empty vendor string in GNU target triplets., Ludovic Courtès, 2022/06/16