--- /usr/share/pear/phing/tasks/ext/simpletest/SimpleTestTask.php	2007-03-09 11:19:42.000000000 +0100
+++ ext/simpletest/SimpleTestTask.php	2008-10-28 09:25:47.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * $Id: SimpleTestTask.php 82 2006-07-07 18:15:35Z mrook $
+ * $Id: SimpleTestTask.php 284 2007-11-03 08:57:48Z hans $
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -28,7 +28,7 @@
  * Runs SimpleTest tests.
  *
  * @author Michiel Rook <michiel.rook@gmail.com>
- * @version $Id: SimpleTestTask.php 82 2006-07-07 18:15:35Z mrook $
+ * @version $Id: SimpleTestTask.php 284 2007-11-03 08:57:48Z hans $
  * @package phing.tasks.ext.simpletest
  * @since 2.2.0
  */
@@ -41,6 +41,15 @@
 	private $errorproperty;
 	private $printsummary = false;
 	private $testfailed = false;
+    private $debug = false;
+
+    public function setDebug($debug) {
+        $this->debug = $debug;
+    }
+
+    public function getDebug() {
+        return $this->debug;
+    }
 
 	/**
 	 * Initialize Task.
@@ -59,6 +68,7 @@
 		require_once 'simpletest/xml.php';
 		require_once 'simpletest/test_case.php';
 		require_once 'phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php';
+		require_once 'phing/tasks/ext/simpletest/SimpleTestDebugResultFormatter.php';
 		require_once 'phing/tasks/ext/simpletest/SimpleTestFormatterElement.php';
 	}
 	
@@ -180,7 +190,12 @@
 		}
 		
 		$this->execute($group);
-		
+
+		if ($this->testfailed && $this->formatters[0]->getFormatter() instanceof SimpleTestDebugResultFormatter ) {
+            $this->getDefaultOutput()->write("Failed tests: ");
+            $this->formatters[0]->getFormatter()->printFailingTests();
+        }
+
 		if ($this->testfailed)
 		{
 			throw new BuildException("One or more tests failed");
@@ -228,11 +243,11 @@
 				$this->testfailed = true;
 			}
 		}
-	}
+       	}
 
 	private function getDefaultOutput()
 	{
 		return new LogWriter($this);
 	}
 }
-?>
\ No newline at end of file
+?>

