guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code coverage


From: Jeremy Korwin
Subject: Re: Code coverage
Date: Tue, 16 Apr 2019 23:56:22 +0200

Le samedi 13 avril 2019 à 17:59 +0200, Amirouche Boubekki a écrit :
> 
> 
> Le sam. 13 avr. 2019 à 16:52, Jeremy Korwin-Zmijowski <
> address@hidden> a écrit :
> > Le vendredi 12 avril 2019 à 12:35 +0200, address@hidden
> >  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]