run_all_tests.php in SimpleTest 5
File
run_all_tests.php
View source
<?php
chdir(realpath(dirname(__FILE__) . '/../../'));
if (file_exists('./includes/bootstrap.inc')) {
include_once './includes/bootstrap.inc';
}
else {
chdir(getcwd() . '/../../');
if (file_exists('./includes/bootstrap.inc')) {
include_once './includes/bootstrap.inc';
}
else {
exit("bootstrap.inc could not be loaded\n");
}
}
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
simpletest_load();
if (!ini_get('safe_mode')) {
set_time_limit(360);
}
$tests = NULL;
$reporter = 'html';
if (SimpleReporter::inCli()) {
$reporter = 'text';
if ($argc == 2) {
$tests = explode(',', $argv[1]);
}
}
else {
if ($_GET['include']) {
$tests = explode(',', $_GET['include']);
}
if ($_GET['reporter'] && ($_GET['reporter'] == 'xml' || $_GET['reporter'] == 'html')) {
$reporter = $_GET['reporter'];
}
else {
$reporter = 'html';
}
}
simpletest_run_tests($tests, $reporter);