private $fuzzSeed = 0;
private $memoryLimit = 50;
+ public $regex = "";
+ private $savedGlobals = array();
+
/**
* Sets terminal colorization and diff/quick modes depending on OS and
* command-line options (--color and --quick).
: new DummyTermColorer();
$this->showDiffs = !isset( $options['quick'] );
- $this->showProgress = !isset( $options['quiet'] );
- $this->showFailure = !(
- isset( $options['quiet'] )
- && ( isset( $options['record'] )
- || isset( $options['compare'] ) ) ); // redundant output
+ $this->showProgress = false; #!isset( $options['quiet'] );
+ $this->showFailure = false; /* !( */
+ /* isset( $options['quiet'] ) */
+ /* && ( isset( $options['record'] ) */
+ /* || isset( $options['compare'] ) ) ); // redundant output */
$this->showOutput = isset( $options['show-output'] );
-
if ( isset( $options['regex'] ) ) {
if ( isset( $options['record'] ) ) {
echo "Warning: --record cannot be used with --regex, disabling --record\n";
$this->setupRecorder( $options );
$this->keepUploads = isset( $options['keep-uploads'] );
+ $this->uploadDir = $this->setupUploadDir();
if ( isset( $options['seed'] ) ) {
$this->fuzzSeed = intval( $options['seed'] ) - 1;
}
}
- /**
- * Remove last character if it is a newline
- */
- public function chomp( $s ) {
- if ( substr( $s, -1 ) === "\n" ) {
- return substr( $s, 0, -1 );
- }
- else {
- return $s;
- }
- }
-
/**
* Run a fuzz test series
* Draw input from a set of test files
}
- $this->teardownGlobals();
-
- if ( $result === $out && ( $noxml === true || $this->wellFormed( $out ) ) ) {
- return $this->showSuccess( $desc );
+ if ( method_exists( $this->recorder, "showTestResult" ) ) {
+ return $this->recorder->showTestResult( $desc, $result, $out );
+ } else if ( $result === $out && ( $noxml === true || $this->wellFormed( $out ) ) ) {
+ return ParserTestSuiteBackend::showSuccess( $desc, $result, $out );
} else {
- return $this->showFailure( $desc, $result, $out );
+ return ParserTestSuiteBackend::showFailure( $desc, $result, $out );
}
}
'wgStyleSheetPath' => '/skins',
'wgSitename' => 'MediaWiki',
'wgLanguageCode' => $lang,
- 'wgDBprefix' => $wgDBtype != 'oracle' ? 'parsertest_' : 'pt_',
'wgRawHtml' => isset( $opts['rawhtml'] ),
'wgLang' => null,
'wgContLang' => null,
if ( $wgDBtype == 'oracle' )
$db->query( 'BEGIN FILL_WIKI_INFO; END;' );
- $this->changePrefix( $wgDBtype != 'oracle' ? 'parsertest_' : 'pt_' );
+ if ( ( $wgDBtype != 'oracle' && $wgDBprefix != 'parsertest_' )
+ && $wgDBprefix != 'pt_' ) {
+ $this->changePrefix( $wgDBtype != 'oracle' ? 'parsertest_' : 'pt_' );
+ }
# Hack: insert a few Wikipedia in-project interwiki prefixes,
# for testing inter-language links
global $wgMessageCache, $wgMemc;
$wgMessageCache = new MessageCache( $wgMemc, true, 3600 );
- $this->uploadDir = $this->setupUploadDir();
$user = User::createNew( 'WikiSysop' );
$image = wfLocalFile( Title::makeTitle( NS_FILE, 'Foobar.jpg' ) );
$image->recordUpload2( '', 'Upload of some lame file', 'Some lame file', array(
global $wgDBtype;
if ( !$this->databaseSetupDone ) {
+ $this->teardownGlobals();
return;
}
$this->teardownUploadDir( $this->uploadDir );
if ( $this->useTemporaryTables ) {
# Don't need to do anything
+ $this->teardownGlobals();
return;
}
if ( $wgDBtype == 'oracle' )
$db->query( 'BEGIN FILL_WIKI_INFO; END;' );
+
+ $this->teardownGlobals();
}
/**