Skip to content

Commit

Permalink
Warning when running tests without flush=1
Browse files Browse the repository at this point in the history
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 #620
  • Loading branch information
chillu committed Jul 6, 2012
1 parent c072dc4 commit 6466993
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions dev/TestRunner.php
Expand Up @@ -106,6 +106,14 @@ function init() {
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() {
Expand Down
10 changes: 9 additions & 1 deletion tests/bootstrap.php
Expand Up @@ -62,4 +62,12 @@
TestRunner::use_test_manifest();

// 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
);
}

0 comments on commit 6466993

Please sign in to comment.