Allow for determining testing coverage

cwgordon7 - April 5, 2008 - 18:00
Project:SimpleTest
Version:7.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

The attached patch allows for integration with the spikephpcoverage framework. Basically, it checks to see if a subdirectory of the simpletest module "spikephpcoverage" exists, and if it does, starts it up, and has it generate a report on which lines of code were called (and which were not) during the test. Requires the spikephpcoverage package from http://developer.spikesource.com/wiki/index.php/Projects:phpcoverage to be installed and set up properly.

I was not able to run all tests locally without apache crashing, but a sample of the report generated by a single test can be found at http://cwgordon.com/simpletest/coverage_example/details/index.html.

There should be no effect upon anyone not attempting to determine the test coverage.

AttachmentSize
simpletest_coverage.patch1.77 KB

#1

moshe weitzman - April 5, 2008 - 18:16

Looks nice. Uses xdebug for the heavy lifting. Thats good.

#2

cwgordon7 - April 5, 2008 - 19:35

Coding standards.

**hangs head in shame**. SHAME!!!

AttachmentSize
simpletest_coverage_02.patch1.9 KB

#3

Rok Žlender - April 7, 2008 - 09:07

What if we create a ST hook that would be run before test starts and after with run and stop params. This way we could move stuff like this which is not needed for regular tests into a diff module. This module can still be included with simpletest.

#4

cwgordon7 - April 7, 2008 - 20:44

Oh that would be completely AWESOME! Complete +1!

#5

Rok Žlender - April 19, 2008 - 13:00

Ok code for new hook as a patch and new module that includes phpcoverage as a tar ball

AttachmentSize
php_coverage.zip607.97 KB
newhook.patch1.28 KB

#6

boombatower - May 15, 2008 - 00:51
Status:patch (code needs review)» duplicate

http://drupal.org/node/252292

 
 

Drupal is a registered trademark of Dries Buytaert.