Custom Code Coverage

I have some scripts which will test other scripts, and it is not PHPUnit tests.

I can gather the information of the code coverage my self and save it to some place, using the docs of xdebug as a guide to get the coverage data:
http://xdebug.org/docs/code_coverage

but I wonder how to load these reports into the editor to see the covered lines?

I noticed the option Tools -->> Show Code Coverage data, and it asked for a Coverage Suite, but I couldn't figure out what is it?

Is it the coverage data file? or some xml for the tests?

How can I generate that Coverage Suite from the data coming from xdebug if possible?

2 comments

Hi there,

"Tools | Show Code Coverage data" is for loading coverage data collected by PHPUnit. The data can be anything -- it just needs to be in correct format.

Here is an idea:

  1. Create some PHPUnit test and generate such coverage file
  2. Look at the structure of that XML file and maybe you will be able to convert (format) your own xdebug generated data into the same format (or look at how PHPUnit itself does it).


Maybe there is such tool already exists somewhere on internet (that can do such conversion for you) -- I never looked for it myself.

0

Thank you very much for your fast reply, and I think I know now how to proceed.

0

Please sign in to leave a comment.