<commit_before><?php

require_once(dirname(dirname(__FILE__)) . '/bootstrap.php');

error_reporting(E_ALL ^ E_DEPRECATED);

require_once('simpletest/autorun.php');

Gwilym_Autoloader::addPath(dirname(__FILE__));

class AllTests extends TestSuite {
	function AllTests() {
		$this->TestSuite('All tests');
		$this->addTestClass('Tests_Gwilym_Event');
		//$this->addTestClass('Tests_Gwilym_Router_Standard_Reverse');
	}
}<commit_msg>change test running to not use autorun and to generate code coverage if coverage=1 in url re-enable router tests<commit_after><?php

require_once(dirname(dirname(__FILE__)) . '/bootstrap.php');

error_reporting(E_ALL ^ E_DEPRECATED);

require_once dirname(__FILE__) . '/simpletest/unit_tester.php';
require_once dirname(__FILE__) . '/simpletest/mock_objects.php';
require_once dirname(__FILE__) . '/simpletest/collector.php';

class AllTests extends TestSuite {
	function AllTests() {
		$this->TestSuite('All tests');
		$this->addTestClass('Tests_Gwilym_Event');
		$this->addTestClass('Tests_Gwilym_Router_Standard_Reverse');
	}
}

Gwilym_Autoloader::addPath(dirname(__FILE__));
$suite = new AllTests();

if (@$_GET['coverage']) {
	global $PHPCOVERAGE_HOME;
	$PHPCOVERAGE_HOME = dirname(__FILE__) . '/spikephpcoverage';
	require_once($PHPCOVERAGE_HOME . '/phpcoverage.inc.php');
	require_once($PHPCOVERAGE_HOME . '/CoverageRecorder.php');
	require_once($PHPCOVERAGE_HOME . '/reporter/HtmlCoverageReporter.php');
	$spikePhpCoverageHtmlReporter = new HtmlCoverageReporter("Code Coverage Report", "", "report");

	$include = array(
		GWILYM_BASE_DIR,
	);

	$exclude = array(
		GWILYM_APP_DIR . '/var',
		GWILYM_LIB_DIR . '/Twig',
		dirname(__FILE__),
	);

	$spikePhpCoverageRecorder = new CoverageRecorder($include, $exclude, $spikePhpCoverageHtmlReporter);
	$spikePhpCoverageRecorder->startInstrumentation();
}

$suite->run(new DefaultReporter());

if (@$_GET['coverage']) {
	$spikePhpCoverageRecorder->stopInstrumentation();
	set_time_limit(0);
	$spikePhpCoverageRecorder->generateReport();
	echo '<pre>';
	$spikePhpCoverageHtmlReporter->printTextSummary();
	echo '</pre>';
}
{'fraction_non_alphanumeric': 0.1482889733840304, 'fraction_numerical': 0.0009505703422053232, 'mean_word_length': 7.320158102766799, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3580369', 'n_tokens_mistral': 775, 'n_tokens_neox': 741, 'n_words': 110}