Index: trunk/phase3/maintenance/parserTests.inc |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | |
28 | 28 | /** */ |
29 | 29 | $options = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record' ); |
30 | | -$optionsWithArgs = array( 'regex', 'seed' ); |
| 30 | +$optionsWithArgs = array( 'regex', 'seed', 'setversion' ); |
31 | 31 | |
32 | 32 | require_once( 'commandLine.inc' ); |
33 | 33 | require_once( "$IP/maintenance/parserTestsParserHook.php" ); |
— | — | @@ -1396,7 +1396,7 @@ |
1397 | 1397 | * and all that fun stuff |
1398 | 1398 | */ |
1399 | 1399 | function start() { |
1400 | | - global $wgDBtype, $wgDBprefix; |
| 1400 | + global $wgDBtype, $wgDBprefix, $options; |
1401 | 1401 | $this->db->begin(); |
1402 | 1402 | |
1403 | 1403 | if( ! $this->db->tableExists( 'testrun' ) |
— | — | @@ -1415,7 +1415,8 @@ |
1416 | 1416 | $this->db->insert( 'testrun', |
1417 | 1417 | array( |
1418 | 1418 | 'tr_date' => $this->db->timestamp(), |
1419 | | - 'tr_mw_version' => SpecialVersion::getVersion(), |
| 1419 | + 'tr_mw_version' => isset( $options['setversion'] ) ? |
| 1420 | + $options['setversion'] : SpecialVersion::getVersion(), |
1420 | 1421 | 'tr_php_version' => phpversion(), |
1421 | 1422 | 'tr_db_version' => $this->db->getServerVersion(), |
1422 | 1423 | 'tr_uname' => php_uname() |
Index: trunk/phase3/maintenance/parserTests.php |
— | — | @@ -40,6 +40,8 @@ |
41 | 41 | --file=<testfile> Run test cases from a custom file instead of parserTests.txt |
42 | 42 | --record Record tests in database |
43 | 43 | --compare Compare with recorded results, without updating the database. |
| 44 | + --setversion When using --record, set the version string to use (useful |
| 45 | + with git-svn so that you can get the exact revision) |
44 | 46 | --keep-uploads Re-use the same upload directory for each test, don't delete it |
45 | 47 | --fuzz Do a fuzz test instead of a normal test |
46 | 48 | --seed <n> Start the fuzz test from the specified seed |