API CHANGE: Added dev/tests/build, which runs everything, meaning that dev/tests/all doesn't need to run PhpSyntaxTes

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90059 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-10-23 03:06:59 +00:00
parent 0a1392324a
commit 599adc97b1

View File

@ -44,6 +44,8 @@ class TestRunner extends Controller {
'endsession' => 'endsession',
'cleanupdb' => 'cleanupdb',
'module/$ModuleName' => 'module',
'all' => 'all',
'build' => 'build',
'$TestCase' => 'only',
);
@ -76,9 +78,29 @@ class TestRunner extends Controller {
}
/**
* Run all test classes
* Run test classes that should be run with every commit.
* Currently excludes PhpSyntaxTest
*/
function all() {
function all() {
$tests = ClassInfo::subclassesFor('SapphireTest');
array_shift($tests);
unset($tests['FunctionalTest']);
// Remove tests that don't need to be executed every time
unset($tests['PhpSyntaxTest']);
foreach($tests as $class => $v) {
$reflection = new ReflectionClass($class);
if(!$reflection->isInstantiable()) unset($tests[$class]);
}
$this->runTests($tests);
}
/**
* Run test classes that should be run before build - i.e., everything possible.
*/
function build() {
$tests = ClassInfo::subclassesFor('SapphireTest');
array_shift($tests);
unset($tests['FunctionalTest']);
@ -88,8 +110,10 @@ class TestRunner extends Controller {
}
$this->runTests($tests);
}
/**
* Browse all enabled test cases in the environment
*/