From unknown Sun Jun 15 08:35:59 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#54911 <54911@debbugs.gnu.org> To: bug#54911 <54911@debbugs.gnu.org> Subject: Status: Missing modules argument for coverage-data->lcov Reply-To: bug#54911 <54911@debbugs.gnu.org> Date: Sun, 15 Jun 2025 15:35:59 +0000 retitle 54911 Missing modules argument for coverage-data->lcov reassign 54911 guile submitter 54911 Jessica Tallon severity 54911 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 13 10:08:50 2022 Received: (at submit) by debbugs.gnu.org; 13 Apr 2022 14:08:50 +0000 Received: from localhost ([127.0.0.1]:53447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nedfu-0008Ex-Hg for submit@debbugs.gnu.org; Wed, 13 Apr 2022 10:08:50 -0400 Received: from lists.gnu.org ([209.51.188.17]:39966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nedft-0008Eq-B5 for submit@debbugs.gnu.org; Wed, 13 Apr 2022 10:08:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nedft-0007oD-7p for bug-guile@gnu.org; Wed, 13 Apr 2022 10:08:49 -0400 Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]:33488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1nedfr-0001vr-BP for bug-guile@gnu.org; Wed, 13 Apr 2022 10:08:48 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Kdkw95HcPz9sTY for ; Wed, 13 Apr 2022 16:08:41 +0200 (CEST) From: Jessica Tallon To: bug-guile@gnu.org Subject: Missing modules argument for coverage-data->lcov Date: Wed, 13 Apr 2022 16:01:27 +0200 Message-ID: <87tuax6pp7.fsf@tsyesika.se> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2001:67c:2050:0:465::101; envelope-from=tsyesika@tsyesika.se; helo=mout-p-101.mailbox.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, I noticed the documentation specify that the `coverage-data->lcov` function should be able to take modules to limit the scope of the data that's coverted to lcov. From the docs: -- Scheme Procedure: coverage-data->lcov data port #:key modules Traverse code coverage information DATA, as obtained with =E2=80=98with-code-coverage=E2=80=99, and write coverage information t= o port in the =E2=80=98.info=E2=80=99 format used by LCOV (http://ltp.sourceforge.net/coverage/lcov.php). The report will include all of MODULES (or, by default, all the currently loaded modules) even if their code was not executed. However I noticed that this didn't match the code. I've attached a patch which implements the behavour described in the docs. Thanks, Jessica. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-missing-modules-argument-for-coverage-data-lcov.patch Content-Description: patch adding missing modules argument >From 828daf200539d3a642fcf8210df7b58aa0d5fede Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Wed, 13 Apr 2022 15:57:24 +0200 Subject: [PATCH] Fix 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 | 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)) -- 2.35.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 16 04:03:40 2022 Received: (at 54911-done) by debbugs.gnu.org; 16 Jun 2022 08:03:40 +0000 Received: from localhost ([127.0.0.1]:40676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1kTc-0006WC-0O for submit@debbugs.gnu.org; Thu, 16 Jun 2022 04:03:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1kTY-0006Vy-M9 for 54911-done@debbugs.gnu.org; Thu, 16 Jun 2022 04:03:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1kTR-0003OX-Cv; Thu, 16 Jun 2022 04:03:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=g5tEHQ0dkOTGO3p13yW0gOXdiWE8abwq2YhoejyhDyY=; b=TsRaWseQHNewwcAn/qHB 9N6l7o8srZSB/e5+56L0KiRXMTDmLw5W9p/3rzuFbxiVukyj/FKbqcIFTyDQN/yQSfeZLCLl4cTF7 /WBmuqp5d9m6ZwpZVQD3ooPNjE72ZdktJBtZG0f1SeooHiiQyGVWOreSUShMa8vNnvhuxwkVcWeAX EcqGABghYpboRIr108LesTmSfAa73s6BL6VoT1PGz4PRsNBSBcK9Hy7IfYhatQUBZk6bKLyxUZT+i IRemIa6HQfKsQJo4u70iPL83STsYf4K53SSmZrLZE0qDg7mOKrx/iFb6d/rhF3An8he5LfljA11yI gDJfPyU7gv8ACg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56551 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1kTQ-0003JF-Td; Thu, 16 Jun 2022 04:03:29 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Jessica Tallon Subject: Re: bug#54911: Missing modules argument for coverage-data->lcov References: <87tuax6pp7.fsf@tsyesika.se> Date: Thu, 16 Jun 2022 10:03:26 +0200 In-Reply-To: <87tuax6pp7.fsf@tsyesika.se> (Jessica Tallon's message of "Wed, 13 Apr 2022 16:01:27 +0200") Message-ID: <87zgidnigh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54911-done Cc: 54911-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Jessica, Jessica Tallon skribis: >>>From 828daf200539d3a642fcf8210df7b58aa0d5fede Mon Sep 17 00:00:00 2001 > From: Jessica Tallon > Date: Wed, 13 Apr 2022 15:57:24 +0200 > Subject: [PATCH] Fix 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. I added a ChangeLog-style entry and committed it. Thanks for fixing this issue! Ludo=E2=80=99. From unknown Sun Jun 15 08:35:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 14 Jul 2022 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator