2004-09-22 12:25:40 +00:00
|
|
|
<?php
|
2004-09-23 00:33:07 +00:00
|
|
|
# Copyright (C) 2004 Brion Vibber <brion@pobox.com>
|
|
|
|
|
# http://www.mediawiki.org/
|
2005-07-06 16:17:02 +00:00
|
|
|
#
|
2004-09-23 00:33:07 +00:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
2005-07-06 16:17:02 +00:00
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
2004-09-23 00:33:07 +00:00
|
|
|
# (at your option) any later version.
|
2005-07-06 16:17:02 +00:00
|
|
|
#
|
2004-09-23 00:33:07 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
2005-07-06 16:17:02 +00:00
|
|
|
#
|
2004-09-23 00:33:07 +00:00
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
2006-04-05 07:43:17 +00:00
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-09-23 00:33:07 +00:00
|
|
|
# http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
|
2004-09-22 12:25:40 +00:00
|
|
|
/**
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @file
|
|
|
|
|
* @ingroup Maintenance
|
2004-09-22 12:25:40 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** */
|
2005-07-06 16:17:02 +00:00
|
|
|
require('parserTests.inc');
|
2004-09-22 12:25:40 +00:00
|
|
|
|
2004-10-27 09:21:25 +00:00
|
|
|
if( isset( $options['help'] ) ) {
|
2006-10-18 09:22:33 +00:00
|
|
|
echo <<<ENDS
|
2004-10-27 09:21:25 +00:00
|
|
|
MediaWiki $wgVersion parser test suite
|
2008-08-26 14:37:15 +00:00
|
|
|
Usage: php parserTests.php [options...]
|
|
|
|
|
|
2004-10-27 09:21:25 +00:00
|
|
|
Options:
|
2006-10-18 09:22:33 +00:00
|
|
|
--quick Suppress diff output of failed tests
|
|
|
|
|
--quiet Suppress notification of passed tests (shows only failed tests)
|
|
|
|
|
--show-output Show expected and actual output
|
2008-08-26 14:37:15 +00:00
|
|
|
--color[=yes|no] Override terminal detection and force color output on or off
|
2007-01-17 21:24:41 +00:00
|
|
|
use wgCommandLineDarkBg = true; if your term is dark
|
2006-10-18 09:22:33 +00:00
|
|
|
--regex Only run tests whose descriptions which match given regex
|
2008-08-26 14:37:15 +00:00
|
|
|
--file=<testfile> Run test cases from a custom file instead of parserTests.txt
|
2007-01-09 14:20:50 +00:00
|
|
|
--record Record tests in database
|
2007-01-22 09:22:17 +00:00
|
|
|
--compare Compare with recorded results, without updating the database.
|
2009-05-15 19:23:00 +00:00
|
|
|
--setversion When using --record, set the version string to use (useful
|
|
|
|
|
with git-svn so that you can get the exact revision)
|
2008-01-05 12:20:54 +00:00
|
|
|
--keep-uploads Re-use the same upload directory for each test, don't delete it
|
2008-08-26 14:37:15 +00:00
|
|
|
--fuzz Do a fuzz test instead of a normal test
|
|
|
|
|
--seed <n> Start the fuzz test from the specified seed
|
2006-10-18 09:22:33 +00:00
|
|
|
--help Show this help message
|
2009-07-29 01:10:09 +00:00
|
|
|
--run-disabled run disabled tests
|
2009-07-30 22:24:04 +00:00
|
|
|
--upload Upload test results to remote wiki (per \$wgParserTestRemote)
|
2004-10-27 09:21:25 +00:00
|
|
|
|
2006-10-18 09:22:33 +00:00
|
|
|
ENDS;
|
2005-07-06 16:17:02 +00:00
|
|
|
exit( 0 );
|
2004-10-27 09:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2004-10-15 17:46:42 +00:00
|
|
|
# There is a convention that the parser should never
|
|
|
|
|
# refer to $wgTitle directly, but instead use the title
|
|
|
|
|
# passed to it.
|
|
|
|
|
$wgTitle = Title::newFromText( 'Parser test script do not use' );
|
2006-07-11 14:11:23 +00:00
|
|
|
$tester = new ParserTest();
|
2004-09-23 00:33:07 +00:00
|
|
|
|
2006-06-01 04:00:41 +00:00
|
|
|
if( isset( $options['file'] ) ) {
|
2006-11-11 14:36:47 +00:00
|
|
|
$files = array( $options['file'] );
|
2006-06-01 04:00:41 +00:00
|
|
|
} else {
|
2006-11-11 14:36:47 +00:00
|
|
|
// Default parser tests and any set from extensions or local config
|
|
|
|
|
$files = $wgParserTestFiles;
|
2006-06-01 04:00:41 +00:00
|
|
|
}
|
2006-12-26 21:26:18 +00:00
|
|
|
|
|
|
|
|
# Print out software version to assist with locating regressions
|
|
|
|
|
$version = SpecialVersion::getVersion();
|
2007-01-19 09:00:45 +00:00
|
|
|
echo( "This is MediaWiki version {$version}.\n\n" );
|
2007-06-29 01:19:14 +00:00
|
|
|
|
2008-08-26 14:37:15 +00:00
|
|
|
if ( isset( $options['fuzz'] ) ) {
|
|
|
|
|
$tester->fuzzTest( $files );
|
|
|
|
|
} else {
|
|
|
|
|
$ok = $tester->runTestsFromFiles( $files );
|
2009-02-05 23:41:00 +00:00
|
|
|
exit ($ok ? 0 : 1);
|
2008-08-26 14:37:15 +00:00
|
|
|
}
|