Getting coverage from PHP core

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
bnoam
Forum Newbie
Posts: 5
Joined: Sun Jan 24, 2010 5:58 am

Getting coverage from PHP core

Post by bnoam »

Hello,

I would like some help with getting coverage data of PHP core. I know the HTML coverage files are under PHP web site, but I need the actual data files *.gcda that are created from the tests in order to import them to my own coverage tool.

So I have the installation src files "php-5.2.9.tar.gz" and I would like to have instructions on how to get the coverage data files.

Thanks.

Noam
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Getting coverage from PHP core

Post by Weirdan »

bnoam
Forum Newbie
Posts: 5
Joined: Sun Jan 24, 2010 5:58 am

Re: Getting coverage from PHP core

Post by bnoam »

Thanks for your reply,

I already visited this site, but it didn't help me.

I need to combine it with the the tests that php provides (there are about 6000 tests).

Can you please write in more details the steps I need in order to - first instrument the files, and then get run tests coverage results?

Noam
bnoam
Forum Newbie
Posts: 5
Joined: Sun Jan 24, 2010 5:58 am

Re: Getting coverage from PHP core

Post by bnoam »

Anyone?

I'll explain myself again in case I wasn't clear.

When I unzip php-5.2.9.tar.gz I get the PHP core files. These files contain, among the rest, about 800 c files. I would like to get the coverage results on these c files from the PHP built-in tests.Not as HTML but as the raw data that gcov exports.

Thanks

Noam
User avatar
markusn00b
Forum Contributor
Posts: 298
Joined: Sat Oct 20, 2007 2:16 pm
Location: York, England

Re: Getting coverage from PHP core

Post by markusn00b »

You need to configure PHP with --enable-gcov. This will then generate the Makefile.gcov file. From there, you make && make test, and you should find your gcov data.
Post Reply