r70323 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70322‎ | r70323 | r70324 >
Date:08:09, 2 August 2010
Author:mglaser
Status:ok
Tags:
Comment:
* modified runTests to run suites instead of single tests. this fixes r70215
Modified paths:
  • /trunk/phase3/includes/specials/SpecialSelenium.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialSelenium.php
@@ -42,21 +42,24 @@
4343 }
4444
4545 function runTests() {
46 - global $wgSeleniumTests, $wgOut;
 46+ global $wgSeleniumTestSuites, $wgOut, $wgSeleniumLogger;
4747 SeleniumLoader::load();
4848
4949 $result = new PHPUnit_Framework_TestResult;
50 - $logger = new SeleniumTestHTMLLogger;
51 - $result->addListener( new SeleniumTestListener( $logger ) );
52 - $logger->setHeaders();
 50+ $wgSeleniumLogger = new SeleniumTestHTMLLogger;
 51+ $result->addListener( new SeleniumTestListener( $wgSeleniumLogger ) );
 52+ //$wgSeleniumLogger->setHeaders();
5353
5454 // run tests
55 - $suite = new SeleniumTestSuite;
56 - foreach ( $wgSeleniumTests as $testClass ) {
57 - $suite->addTest( new $testClass );
 55+ $wgOut->addHTML( '<div class="selenium">' );
 56+
 57+ // for some really strange reason, foreach doesn't work here. It produces an infinite loop,
 58+ // executing only the first test suite.
 59+ for ( $i = 0; $i < count( $wgSeleniumTestSuites ); $i++ ) {
 60+ $suite = new $wgSeleniumTestSuites[$i];
 61+ $suite->addTests();
 62+ $suite->run( $result );
5863 }
59 - $wgOut->addHTML( '<div class="selenium">' );
60 - $suite->run( $result );
6164 $wgOut->addHTML( '</div>' );
6265 }
6366 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70215changed testrunner in order to run suites instead of single tests. Patch supp...mglaser12:00, 31 July 2010

Status & tagging log