Adds a make target to build phpunit code coverage which will be generated to
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 27 Sep 2010 20:19:22 +0000 (20:19 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 27 Sep 2010 20:19:22 +0000 (20:19 +0000)
/docs/code-coverage . You will need the Xdebug PHP extension to run code
coverage.

docs/code-coverage/README [new file with mode: 0644]
maintenance/tests/phpunit/Makefile

diff --git a/docs/code-coverage/README b/docs/code-coverage/README
new file mode 100644 (file)
index 0000000..7bc55ce
--- /dev/null
@@ -0,0 +1,2 @@
+This directory is for the auto-generated phpunit code coverage.
+Run 'make coverage' in the maintenance/tests/phpunit subdirectory to build.
index 5506e5e..7c0549d 100644 (file)
@@ -1,20 +1,35 @@
-.PHONY: help test phpunit install
+.PHONY: help test phpunit install coverage
+
+CONFIG_FILE = suite.xml
+FLAGS = 
+PU = phpunit --configuration ${CONFIG_FILE}
 
 all test: phpunit
 
 phpunit:
-       phpunit --configuration suite.xml
+       ${PU}
 
 install:
        pear channel-discover pear.phpunit.de
        pear install phpunit/PHPUnit
 
 tap:
-       phpunit --configuration suite.xml --tap
+       ${PU} --tap
+
+coverage:
+       ${PU} --coverage-html ../../../docs/code-coverage
 
 help:
+       # Usage:
+       #   make <target> [OPTION=value]
+       #
        # Targets:
        #   phpunit (default)   Run all the tests with phpunit
        #   install             Install PHPUnit from phpunit.de
        #   tap                 Run the tests individually through Test::Harness's prove(1)     
        #   help                You're looking at it!
+       #   coverage            Run the tests and generates an HTML code coverage report
+       #                       You will need the Xdebug PHP extension for the later.
+       #  Options:
+       #   CONFIG_FILE         Path to a PHPUnit configuration file (default: suite.xml)
+       #   FLAGS               Additional flags to pass to PHPUnit