Add parser tests to the 'Parser' group
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 18 Oct 2010 21:36:58 +0000 (21:36 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 18 Oct 2010 21:36:58 +0000 (21:36 +0000)
Makefile gets some additional targets

maintenance/tests/phpunit/Makefile
maintenance/tests/phpunit/includes/parser/MediaWikiParserTest.php

index 0784c4a..a2097e8 100644 (file)
@@ -1,4 +1,5 @@
-.PHONY: help test phpunit install coverage warning destructive
+.PHONY: help test phpunit install coverage warning destructive parser noparser list-groups
+.DEFAULT: warning
 
 SHELL = /bin/sh
 CONFIG_FILE = $(shell pwd)/suite.xml
@@ -8,6 +9,7 @@ PU = php phpunit.php --configuration ${CONFIG_FILE}
 all test: warning
 
 warning:
+       # Use 'make help' to get usage
        @echo "WARNING -- these tests are DESTRUCTIVE and will alter your wiki."
        @echo "DO NOT RUN THESE TESTS on a production wiki."
        @echo ""
@@ -32,6 +34,15 @@ tap:
 coverage:
        ${PU} --coverage-html ../../../docs/code-coverage
 
+parser:
+       ${PU} --group Parser
+
+noparser:
+       ${PU} --exclude-group Parser
+
+list-groups:
+       ${PU} --list-groups
+
 help:
        # Usage:
        #   make <target> [OPTION=value]
@@ -43,6 +54,10 @@ help:
        #   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.
+       #   [no]parser          Skip or only run Parser tests
+       #
+       #   list-groups         List availabe Tests groups.
+       #
        #  Options:
        #   CONFIG_FILE         Path to a PHPUnit configuration file (default: suite.xml)
        #   FLAGS               Additional flags to pass to PHPUnit
index f441b98..07dfb32 100644 (file)
@@ -24,7 +24,7 @@ class MediaWikiParserTest extends MediaWikiTestSetup {
                $tester->count = 0;
 
                foreach ( $iter as $test ) {
-                       $tester->suite->addTest( new ParserUnitTest( $tester, $test ) );
+                       $tester->suite->addTest( new ParserUnitTest( $tester, $test ), array( 'Parser' ) );
                        $tester->count++;
                }