瀏覽代碼

adding indication of one of the phpunit execution failed

Adar Porat 12 年之前
父節點
當前提交
e2593685da
共有 1 個文件被更改,包括 10 次插入2 次删除
  1. 10 2
      tests/runalltests.php

+ 10 - 2
tests/runalltests.php

@@ -47,10 +47,18 @@ if (!is_executable($PHPUNIT)) {
 $files = glob('{Zend/*/AllTests.php,Zend/*Test.php}', GLOB_BRACE);
 sort($files);
 
+// we'll capture the result of each phpunit execution in this value, so we'll know if something broke
+$result = 0;
+
 // run through phpunit
 while(list(, $file)=each($files)) {
     echo "Executing {$file}" . PHP_EOL;
-    shell_exec($PHPUNIT . ' --stderr -d memory_limit=-1 -d error_reporting=E_ALL\&E_STRICT -d display_errors=1 ' . escapeshellarg($file));
+    system($PHPUNIT . ' --stderr -d memory_limit=-1 -d error_reporting=E_ALL\&E_STRICT -d display_errors=1 ' . escapeshellarg($file), $c_result);
     echo PHP_EOL;
+    
+    if ($c_result) {
+        $result = $c_result;
+    }
 }
-exit(0);
+
+exit($result);