Warning when running tests without flush=1

This is now the default setting for both "sake" and "phpunit"
runs, because of performance reasons (every manifest flush takes
multiple seconds). On the other hand, we want to make errors
like missing classes more obvious to developers.
See discussion in https://github.com/silverstripe/sapphire/pull/620
This commit is contained in:
Ingo Schommer 2012-07-06 12:00:38 +02:00
parent c072dc4757
commit 64669938da
2 changed files with 17 additions and 1 deletions

View File

@ -106,6 +106,14 @@ class TestRunner extends Controller {
if(!PhpUnitWrapper::has_php_unit()) { if(!PhpUnitWrapper::has_php_unit()) {
die("Please install PHPUnit using pear"); die("Please install PHPUnit using pear");
} }
if(!isset($_GET['flush']) || !$_GET['flush']) {
Debug::message(
"WARNING: Manifest not flushed. " .
"Add flush=1 as an argument to discover new classes or files.\n",
false
);
}
} }
public function Link() { public function Link() {

View File

@ -63,3 +63,11 @@ TestRunner::use_test_manifest();
// Remove the error handler so that PHPUnit can add its own // Remove the error handler so that PHPUnit can add its own
restore_error_handler(); restore_error_handler();
if(!isset($_GET['flush']) || !$_GET['flush']) {
Debug::message(
"WARNING: Manifest not flushed. " .
"Add flush=1 as an argument to discover new classes or files.\n",
false
);
}