Skip to content
Browse files

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 #620
  • Loading branch information...
1 parent c072dc4 commit 64669938da908d92d5e2d77639796e9737ba5e5c @chillu chillu committed
Showing with 17 additions and 1 deletion.
  1. +8 −0 dev/TestRunner.php
  2. +9 −1 tests/bootstrap.php
View
8 dev/TestRunner.php
@@ -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() {
View
10 tests/bootstrap.php
@@ -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.
Something went wrong with that request. Please try again.