Skip to content
This repository
Browse code

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...
commit 64669938da908d92d5e2d77639796e9737ba5e5c 1 parent c072dc4
Ingo Schommer authored July 06, 2012
8  dev/TestRunner.php
@@ -106,6 +106,14 @@ function init() {
106 106
 		if(!PhpUnitWrapper::has_php_unit()) {
107 107
 			die("Please install PHPUnit using pear");
108 108
 		}
  109
+
  110
+		if(!isset($_GET['flush']) || !$_GET['flush']) {
  111
+			Debug::message(
  112
+				"WARNING: Manifest not flushed. " .
  113
+				"Add flush=1 as an argument to discover new classes or files.\n",
  114
+				false
  115
+			);
  116
+		}
109 117
 	}
110 118
 	
111 119
 	public function Link() {
10  tests/bootstrap.php
@@ -62,4 +62,12 @@
62 62
 TestRunner::use_test_manifest();
63 63
 
64 64
 // Remove the error handler so that PHPUnit can add its own
65  
-restore_error_handler();
  65
+restore_error_handler();
  66
+
  67
+if(!isset($_GET['flush']) || !$_GET['flush']) {
  68
+	Debug::message(
  69
+		"WARNING: Manifest not flushed. " .
  70
+		"Add flush=1 as an argument to discover new classes or files.\n",
  71
+		false
  72
+	);
  73
+}

0 notes on commit 6466993

Please sign in to comment.
Something went wrong with that request. Please try again.