http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73824

Revision: 73824
Author:   hashar
Date:     2010-09-27 20:19:22 +0000 (Mon, 27 Sep 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/phase3/maintenance/tests/phpunit/Makefile

Added Paths:
-----------
    trunk/phase3/docs/code-coverage/
    trunk/phase3/docs/code-coverage/README


Property changes on: trunk/phase3/docs/code-coverage
___________________________________________________________________
Added: svn:ignore
   + *.css
*.gif
*.html
*.js
*.png


Added: trunk/phase3/docs/code-coverage/README
===================================================================
--- trunk/phase3/docs/code-coverage/README                              (rev 0)
+++ trunk/phase3/docs/code-coverage/README      2010-09-27 20:19:22 UTC (rev 
73824)
@@ -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.

Modified: trunk/phase3/maintenance/tests/phpunit/Makefile
===================================================================
--- trunk/phase3/maintenance/tests/phpunit/Makefile     2010-09-27 19:50:05 UTC 
(rev 73823)
+++ trunk/phase3/maintenance/tests/phpunit/Makefile     2010-09-27 20:19:22 UTC 
(rev 73824)
@@ -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



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to