/** * Run the autogroup_test_coverage tests using one externally defined code coverage reporter * allowing further process of coverage data once tests are over. Supports multiple * instrumentations (code coverage gathering sessions) to be executed. */ public function run_with_external_coverage($simpletestreporter, $covrecorder) { if (moodle_coverage_recorder::can_run_codecoverage() && $this->performcoverage) { $covrecorder->setIncludePaths($this->includecoverage); $covrecorder->setExcludePaths($this->excludecoverage); $covrecorder->start_instrumentation(); parent::run($simpletestreporter); $covrecorder->stop_instrumentation(); } else { // Testing without coverage parent::run($simpletestreporter); } }
while (@ob_end_flush()) { } foreach ($tests as $i => $database) { $dbinfo = $dbinfos[$i]; $UNITTEST->func_test_db = $database; // pass the db to the tests through global print_heading('Running tests on: ' . $dbinfo['name'], '', 3); // TODO: localise // Create the group of tests. $test = new AutoGroupTest(false, true); $test->addTestFile($CFG->libdir . '/dml/simpletest/testdml.php'); $test->addTestFile($CFG->libdir . '/ddl/simpletest/testddl.php'); // Make the reporter, which is what displays the results. $reporter = new ExHtmlReporter($showpasses); set_time_limit(300); $test->run($reporter); unset($UNITTEST->func_test_db); echo '<hr />'; } } // Print the form for adjusting options. print_simple_box_start('center', '70%'); echo '<form method="post" action="dbtest.php">'; echo '<div>'; print_heading("Run functional database tests"); // TODO: localise echo '<p>'; print_checkbox('showpasses', 1, $showpasses, get_string('showpasses', 'simpletest')); echo '</p>'; echo '<p><strong>' . "Databases:" . '</strong>'; echo '<ul>';