From: Antoine Musso Date: Tue, 16 Aug 2011 18:23:13 +0000 (+0000) Subject: enable colors in PHPUnit (redoing r89179). X-Git-Tag: 1.31.0-rc.0~28228 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=e9698b09d8f5be1698535664254335e431cd1140;p=lhc%2Fweb%2Fwiklou.git enable colors in PHPUnit (redoing r89179). suite.xml now comes with colors=true. Under Windows, we override the setting by forging a --no-colors. One can still force color usage under windows by using --colors. --- diff --git a/tests/phpunit/MediaWikiPHPUnitCommand.php b/tests/phpunit/MediaWikiPHPUnitCommand.php index c0d9f3637e..16f73ef738 100644 --- a/tests/phpunit/MediaWikiPHPUnitCommand.php +++ b/tests/phpunit/MediaWikiPHPUnitCommand.php @@ -17,6 +17,17 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command { public static function main( $exit = true ) { $command = new self; + + if( wfIsWindows() ) { + # Windows does not come anymore with ANSI.SYS loaded by default + # PHPUnit uses the suite.xml parameters to enable/disable colors + # which can be then forced to be enabled with --colors. + # The below code inject a parameter just like if the user called + # phpunit with a --no-color option (which does not exist). It + # overrides the suite.xml setting. + # Probably fix bug 29226 + $command->arguments['colors'] = false; + } $command->run($_SERVER['argv'], $exit); } diff --git a/tests/phpunit/suite.xml b/tests/phpunit/suite.xml index e6649beb33..c132f5e1ed 100644 --- a/tests/phpunit/suite.xml +++ b/tests/phpunit/suite.xml @@ -2,7 +2,7 @@