Re: TestFest, which tests to focus on?
| From: | Raghubansh | Date: | Tue, 22 Apr 2008 09:00:38 +0000 |
| Subject: | Re: TestFest, which tests to focus on? | ||
| References: | 1 2 3 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-64216@lists.php.net to get a copy of this message | ||
It would be good to have the complete procedure for finding coverage
documented.
Following steps will help you check the coverage of source by executing only
your testcases
a) Build the php with gcov option if not yet done ( ./configure
--enable-gcov; make)
b) Copy your tests to a dir ( e.g. /home/kraghuba/mytest )
c) Run run-test.php and pass the dir where you tests are present (e.g.
php /workdir/php53/run-tests.php /home/kraghuba/mytest)
d) Later use the lcov and genhtml to generate the coverage report for the
specific source file
e.g. if you are looking for string function coverage, following are
steps:
1) locate the .gcda file, i.e. string.gcda ( ext/standard/string.gcda
)
2) use lcov to generate info file
lcov --directory <php_dir>/ext/standard/string.gcda -c -o
string.info
3) use genhtml to generate html files
genhtml string.info -o /tmp/string
4) firefox /tmp/string/index.html & <= should show you the
coverage
with Regards,
Raghubansh
On Mon, Apr 21, 2008 at 9:31 PM, zoe <zoe.slattery@googlemail.com> wrote:
> Lukas Kahwe Smith wrote:
>
> >
> > > So, is there a way that I can check to see if my test really does
> > > cover that code before submitting it for review? I'm assuming the
> > > answer is no. :-)
> > >
> >
> > No, but at least you see which parts are not executed. So with some
> > basic knowledge of C you should be able to figure out what PHP functions to
> > call to get those parts executed. As you can see from the front page, the
> > actual test runs take quite a lot of time to run.
> >
> Actually, I think there is a way, but Lukas is correct in that it's not
> easy :-). I have done this in the past by removing all the .phpt from the
> source tree except the ones I'm interested in, then building with gcov and
> using lcov to look at the coverage of my test (or set of tests) on their
> own.
>
> I can put some instructions on the wiki (Lukas - anywhere in particular?)
> for Linux. I think it's quite a useful thing to be able to do.
>
> Zoe
>
>
> > regards,
> > Lukas
> >
> >
>
> --
> PHP Quality Assurance Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
with Regards,
Raghubansh