* document --record (would have saved me 1 hour of work this morning)
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 9 Jan 2007 14:20:50 +0000 (14:20 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 9 Jan 2007 14:20:50 +0000 (14:20 +0000)
* --record automaticly create tables if they do not exists.

RELEASE-NOTES
maintenance/parserTests.inc
maintenance/parserTests.php

index eb6d667..ad38eea 100644 (file)
@@ -30,6 +30,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 6638) List block flags in block log entries
 * New script maintenance/language/checkExtensioni18n.php used to check i18n
   progress in the extension repository.
+* Running maintenance/parserTests.php with '--record' option, will now automaticly
+  tries to create its database tables.
 
 == Languages updated ==
 
index e5fd8c6..ec2388c 100644 (file)
@@ -955,6 +955,12 @@ class DbTestRecorder extends TestRecorder  {
 
                $this->db->begin();
 
+               if( ! $this->db->tableExists( 'testrun' ) or ! $this->db->tableExists( 'testitem') ) {
+                       print "WARNING> `testrun` table not found in database. Trying to create table.\n";
+                       dbsource( 'testRunner.sql',  $this->db );
+                       echo "OK, resuming.\n";
+               }
+
                // We'll make comparisons against the previous run later...
                $this->prevRun = $this->db->selectField( 'testrun', 'MAX(tr_id)' );
 
index bd14778..0a11a73 100644 (file)
@@ -31,6 +31,7 @@ MediaWiki $wgVersion parser test suite
 Usage: php parserTests.php [--quick] [--quiet] [--show-output]
                            [--color[=(yes|no|light)]]
                            [--regex=<expression>] [--file=<testfile>]
+                           [--record]
                            [--help]
 Options:
   --quick          Suppress diff output of failed tests
@@ -40,6 +41,7 @@ Options:
                    'light' option is similar to 'yes' but with color for dark backgrounds
   --regex          Only run tests whose descriptions which match given regex
   --file           Run test cases from a custom file instead of parserTests.txt
+  --record         Record tests in database
   --help           Show this help message