/** * Run the autogroup_test_coverage using one internally defined code coverage reporter * automatically generating the coverage report. Only supports one instrumentation * to be executed and reported. */ public function run($simpletestreporter) { global $CFG; if (moodle_coverage_recorder::can_run_codecoverage() && $this->performcoverage) { // Testing with coverage $covreporter = new moodle_coverage_reporter($this->coveragename, $this->coveragedir); $covrecorder = new moodle_coverage_recorder($covreporter); $covrecorder->setIncludePaths($this->includecoverage); $covrecorder->setExcludePaths($this->excludecoverage); $covrecorder->start_instrumentation(); parent::run($simpletestreporter); $covrecorder->stop_instrumentation(); set_time_limit(60 * 10); // it may take a long time to generate the report $covrecorder->generate_report(); moodle_coverage_reporter::print_summary_info(basename($this->coveragedir)); } else { // Testing without coverage parent::run($simpletestreporter); } }