* Removed the perl dependency from the default "make test". There doesn't seem to be a memory issue anymore, but you can always use one of the non-default targets if it recurs.
* Fixed a couple of test/suite names broken in r68544.
* Added custom CSS to Special:Selenium, accidentally missing from r68555.
$result = new PHPUnit_Framework_TestResult;
$logger = new SeleniumTestHTMLLogger;
$result->addListener( new SeleniumTestListener( $logger ) );
+ $logger->setHeaders();
// run tests
$suite = new SeleniumTestSuite;
-# See
-# http://lists.wikimedia.org/pipermail/wikitech-l/2010-February/046657.html
-# for why prove(1) is the default target and not phpunit(1)
+# If you have problems with excessive memory usage, use the "tap" or "separate" targets.
-.PHONY: help test
-all test: tap
+TEST_FILES=$(shell php -r 'include( "./TestFileList.php" ); echo implode( " ", $$testFiles );')
+TEST_FILE_TARGETS=$(subst .php,.target,$(TEST_FILES))
-tap:
- prove -e 'php phpunit.php --tap' *Test*.php
+.PHONY: help test phpunit tap separate install $(TEST_FILE_TARGETS)
+
+all test: phpunit
phpunit:
- phpunit
+ php phpunit
+
+tap:
+ prove -e 'php phpunit --tap' *Test*.php
+
+separate: $(TEST_FILE_TARGETS)
+
+# Need --tap because without it, the target specification doesn't work
+$(TEST_FILE_TARGETS) : %.target : %.php
+ php phpunit --tap $<
install:
pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit
help:
- # Options:
- # test (default) Run the tests individually through Test::Harness's prove(1)
- # phpunit Run all the tests with phpunit
- # install Install PHPUnit from phpunit.de
- # help You're looking at it!
+ # Targets:
+ # phpunit (default) Run all the tests with phpunit
+ # separate Run each test file in a separate process
+ # tap Run the tests individually through Test::Harness's prove(1)
+ # install Install PHPUnit from phpunit.de
+ # help You're looking at it!
public function __construct() {
$this->backend = new ParserTestSuiteBackend;
parent::__construct();
+ $this->setName( 'Parser tests' );
}
public function run( PHPUnit_Framework_TestResult $result = null, $filter = false,
return $result;
}
+ public function toString() {
+ return $this->test['test'];
+ }
+
}
class ParserTestSuiteBackend extends ParserTest {
--- /dev/null
+<?php
+
+$testFiles = array(
+ #'ApiTest.php',
+ #'ApiWatchTest.php',
+ 'CdbTest.php',
+ 'DatabaseSqliteTest.php',
+ 'DatabaseTest.php',
+ 'GlobalTest.php',
+ #'HttpTest.php',
+ 'IPTest.php',
+ 'ImageFunctionsTest.php',
+ 'LanguageConverterTest.php',
+ 'LicensesTest.php',
+ 'LocalFileTest.php',
+ 'MediaWikiParserTest.php',
+ 'MessageTest.php',
+ 'RevisionTest.php',
+ 'SanitizerTest.php',
+ 'SearchDbTest.php',
+ 'SearchEngineTest.php',
+ 'SearchUpdateTest.php',
+ 'SiteConfigurationTest.php',
+ 'TimeAdjustTest.php',
+ 'TitlePermissionTest.php',
+ 'TitleTest.php',
+ 'UploadTest.php',
+ 'UploadFromUrlTestSuite.php',
+ 'XmlTest.php',
+);
EOF;
}
-$command = new PHPUnit_TextUI_Command;
+class MWPHPUnitCommand extends PHPUnit_TextUI_Command {
+ protected function handleCustomTestSuite() {
+ require( dirname( __FILE__ ) . '/TestFileList.php' );
+ $suite = new PHPUnit_Framework_TestSuite;
+ foreach ( $testFiles as $file ) {
+ $suite->addTestFile( $file );
+ }
+ $suite->setName( 'MediaWiki test suite' );
+ $this->arguments['test'] = $suite;
+ }
+}
+
+$command = new MWPHPUnitCommand;
$command->run( $argv );
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
- stopOnFailure="false">
- <testsuite name="MediaWiki Test Suite">
- <!-- <directory>.</directory> -->
- <!-- <file>ApiTest.php</file> -->
- <!-- <file>ApiWatchTest.php</file> -->
- <file>CdbTest.php</file>
- <file>DatabaseSqliteTest.php</file>
- <file>DatabaseTest.php</file>
- <file>GlobalTest.php</file>
- <!--<file>HttpTest.php</file>-->
- <file>IPTest.php</file>
- <file>ImageFunctionsTest.php</file>
- <file>LanguageConverterTest.php</file>
- <file>LicensesTest.php</file>
- <file>LocalFileTest.php</file>
- <file>MediaWikiParserTest.php</file>
- <file>MessageTest.php</file>
- <file>RevisionTest.php</file>
- <file>SanitizerTest.php</file>
- <file>SearchDbTest.php</file>
- <file>SearchEngineTest.php</file>
- <file>SearchUpdateTest.php</file>
- <file>SiteConfigurationTest.php</file>
- <file>TimeAdjustTest.php</file>
- <file>TitlePermissionTest.php</file>
- <file>TitleTest.php</file>
- <file>UploadTest.php</file>
- <file>UploadFromUrlTestSuite.php</file>
- <file>XmlTest.php</file>
- </testsuite>
+ stopOnFailure="false">
+ <!-- for the test file list, see TestFileList.php -->
<groups>
<exclude>
<group>Broken</group>