From 64669938da908d92d5e2d77639796e9737ba5e5c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 6 Jul 2012 12:00:38 +0200 Subject: [PATCH] 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 --- dev/TestRunner.php | 8 ++++++++ tests/bootstrap.php | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dev/TestRunner.php b/dev/TestRunner.php index a11ec5890..697370bae 100644 --- a/dev/TestRunner.php +++ b/dev/TestRunner.php @@ -106,6 +106,14 @@ class TestRunner extends Controller { if(!PhpUnitWrapper::has_php_unit()) { 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() { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 89a4c985f..1904a068f 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -62,4 +62,12 @@ $controller = new FakeController(); TestRunner::use_test_manifest(); // Remove the error handler so that PHPUnit can add its own -restore_error_handler(); \ No newline at end of file +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 + ); +} \ No newline at end of file