From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jeremy Korwin Newsgroups: gmane.lisp.guile.user Subject: Re: Code coverage Date: Tue, 16 Apr 2019 23:56:22 +0200 Message-ID: References: <98f661850c9f26781456a3dd384b75f86d2af52a.camel@korwin-zmijowski.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="146956"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Guile User To: Amirouche Boubekki Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Apr 16 23:57:00 2019 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGW4Z-000c7K-QZ for guile-user@m.gmane.org; Tue, 16 Apr 2019 23:56:59 +0200 Original-Received: from localhost ([127.0.0.1]:43350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGW4Y-0002eA-IR for guile-user@m.gmane.org; Tue, 16 Apr 2019 17:56:58 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGW4D-0002e4-4n for guile-user@gnu.org; Tue, 16 Apr 2019 17:56:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGW4B-0000Ag-3J for guile-user@gnu.org; Tue, 16 Apr 2019 17:56:37 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:47419) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hGW48-00005z-WB for guile-user@gnu.org; Tue, 16 Apr 2019 17:56:35 -0400 X-Originating-IP: 82.232.58.193 Original-Received: from elite (bny92-5-82-232-58-193.fbx.proxad.net [82.232.58.193]) (Authenticated sender: jeremy@korwin-zmijowski.fr) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 92A251C0005; Tue, 16 Apr 2019 21:56:23 +0000 (UTC) In-Reply-To: X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.70.183.197 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15393 Archived-At: Le samedi 13 avril 2019 à 17:59 +0200, Amirouche Boubekki a écrit : > > > Le sam. 13 avr. 2019 à 16:52, Jeremy Korwin-Zmijowski < > jeremy@korwin-zmijowski.fr> a écrit : > > Le vendredi 12 avril 2019 à 12:35 +0200, jeremy@korwin-zmijowski.fr > > a > > écrit : > > > 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 > > > (string-append > > > (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 . > > > > > > then > > > > > > 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. > > > > > > Jeko > > > > > > > The code for Guile 2.2.3 is > > > > (use-modules (system vm coverage) > > (system vm vm) > > (srfi srfi-11)) > > > > (let ((output-directory (string-append > > (getenv "HOME") > > "/Workspace/guile-cybo/coverage"))) > > (let-values (((data . values) > > (with-code-coverage > > (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)))) > > > > Jeko > > I am not sure of what you are trying to achieve. There was recent-ish > thread about code coverage > in guile-devel mailing list: > http://lists.gnu.org/archive/html/guile-devel/2019-02/msg00029.html > > HTH Hello Amirouche ! I am confused. Yesterday, the report gave me the function coverage. Today, after I read the mailing list you pointed out, I deleted the html report and re-launch the coverage (juste to confirm I do have the function coverage). And... I lost the function coverage report ! It never come back haha what's the **** ? I was going to test my coverage by browsing and parsing the html report :( I will give the shot to the patch you give in the mailing list. Jeko