From d8e8f0b05f0438f8bdab6596305e60a15a8e29c3 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 27 Sep 2010 20:19:22 +0000 Subject: [PATCH] Adds a make target to build phpunit code coverage which will be generated to /docs/code-coverage . You will need the Xdebug PHP extension to run code coverage. --- docs/code-coverage/README | 2 ++ maintenance/tests/phpunit/Makefile | 21 ++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 docs/code-coverage/README diff --git a/docs/code-coverage/README b/docs/code-coverage/README new file mode 100644 index 0000000000..7bc55ce2f9 --- /dev/null +++ b/docs/code-coverage/README @@ -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. diff --git a/maintenance/tests/phpunit/Makefile b/maintenance/tests/phpunit/Makefile index 5506e5e0d4..7c0549dd6f 100644 --- a/maintenance/tests/phpunit/Makefile +++ b/maintenance/tests/phpunit/Makefile @@ -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 [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 -- 2.20.1