parserTests: add --filter as an alias of --regex
authorAntoine Musso <hashar@users.mediawiki.org>
Sat, 19 Nov 2011 18:24:43 +0000 (18:24 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Sat, 19 Nov 2011 18:24:43 +0000 (18:24 +0000)
PHPUnit use the --filter option and I keep incorrectly using it for
parserTest. So this is adding an alias of --regex.

tests/parser/parserTest.inc
tests/parserTests.php

index b9fd221..bce481b 100644 (file)
@@ -105,6 +105,9 @@ class ParserTest {
 
                $this->showOutput = isset( $options['show-output'] );
 
+               if ( isset( $options['filter'] ) ) {
+                       $options['regex'] = $options['filter'];
+               }
 
                if ( isset( $options['regex'] ) ) {
                        if ( isset( $options['record'] ) ) {
index 854f077..d930ac5 100644 (file)
@@ -24,8 +24,8 @@
  * @ingroup Testing
  */
 
-$options = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record', 'run-disabled' );
-$optionsWithArgs = array( 'regex', 'seed', 'setversion' );
+$otions = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record', 'run-disabled' );
+$optionsWithArgs = array( 'regex', 'filter', 'seed', 'setversion' );
 
 require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' );
 
@@ -41,6 +41,7 @@ Options:
   --color[=yes|no] Override terminal detection and force color output on or off
                    use wgCommandLineDarkBg = true; if your term is dark
   --regex          Only run tests whose descriptions which match given regex
+  --filter         Alias for --regex
   --file=<testfile> Run test cases from a custom file instead of parserTests.txt
   --record         Record tests in database
   --compare        Compare with recorded results, without updating the database.