]> granicus.if.org Git - php/commitdiff
Fix tests
authorBob Weinand <bobwei9@hotmail.com>
Wed, 4 Jun 2014 00:15:50 +0000 (02:15 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Wed, 4 Jun 2014 00:15:50 +0000 (02:15 +0200)
tests/commands/0002_set.test
tests/commands/0103_register.test
tests/commands/0106_compile.test
tests/run-tests.php

index 7720f94fff61d230554403596fd16b7ee32bd826..468ac6d9ea04fe61b4e477f590d2d9045747980f 100644 (file)
@@ -9,7 +9,6 @@
 # setting notice color
 # Failed to find breakpoint #0
 # oplog disabled
-# not enabled
 # opened oplog test.log
 # nothing
 #################################################
@@ -19,5 +18,4 @@ set color notice none
 set prompt promot>
 set break 0
 set oplog
-set oplog 0
 set oplog test.log
index 38841591caf7fe9722b51939758e502267a5ea7a..703a12f7713b877ddeb92b6def82b7b2aae73c23 100644 (file)
@@ -7,15 +7,15 @@
 #[Registered test_function]
 #array(5) {
 #  [0]=>
-#  string(1) "1"
+#  int(1)
 #  [1]=>
-#  string(1) "2"
+#  int(2)
 #  [2]=>
-#  string(1) "3"
+#  int(3)
 #  [3]=>
-#  string(1) "4"
+#  int(4)
 #  [4]=>
-#  string(1) "5"
+#  int(5)
 #}
 #################################################
 <:
index d79211ddf75d71c67052e99497fdf573c2953579..7193600ea3db7018b75f90b84f649398ce0a9c01 100644 (file)
@@ -14,6 +14,5 @@ define('OUT',
 file_put_contents(OUT, "<?php echo \"Hello World\"; ?>");
 phpdbg_exec(OUT);
 :>
-compile
 run
 quit
index 1fb6fa12242fa150e5c9f4822d08c71eb3f856cf..47a998ccae84d0b9176a9bc9512cbcedc936638d 100644 (file)
@@ -284,6 +284,8 @@ namespace phpdbg\testing {
                                $test->purpose, 
                                $result ? "PASS" : "FAIL",
                                PHP_EOL);
+
+                       return $result;
                }
                
                protected $config;
@@ -426,7 +428,7 @@ namespace phpdbg\testing {
                */
                public function getResult() {
                        $options = sprintf(
-                               '-i%s -qb', $this->file);
+                               '-i%s -nqb', $this->file);
                        
                        if ($this->options) {
                                $options = sprintf(
@@ -492,13 +494,18 @@ namespace phpdbg\testing {
                *
                */
                protected function writeDiff() {
-                       $diff = sprintf(
-                               '%s/%s.diff',
-                               dirname($this->file), basename($this->file));
-                               
                        if (count($this->diff['wants'])) {
-                               if (!in_array('nodiff', $this->config['flags'])) {
-                                       if (($diff = fopen($diff, 'w+'))) {
+                               if (!$this->config->hasFlag('nodiff')) {
+                                       if ($this->config->hasFlag('diff2stdout')) {
+                                               $difffile = "php://stdout";
+                                               file_put_contents($difffile, "====DIFF====\n");
+                                       } else {
+                                               $difffile = sprintf(
+                                                       '%s/%s.diff',
+                                                       dirname($this->file), basename($this->file));
+                                       }
+                               
+                                       if (($diff = fopen($difffile, 'w+'))) {
 
                                                foreach ($this->diff['wants'] as $line => $want) {
                                                        $got = $this->diff['gets'][$line];
@@ -552,6 +559,9 @@ namespace {
 
        $cwd = dirname(__FILE__);
        $cmd = $_SERVER['argv'];
+
+       $retval = 0;
+
        {
                $config = new TestsConfiguration(array(
                        'exec' => realpath(array_shift($cmd)),
@@ -571,7 +581,7 @@ namespace {
                        $tests->logPath($path);
 
                        foreach ($tests->findTests($path) as $test) {
-                               $tests->logTest($path, $test);
+                               $retval |= !$tests->logTest($path, $test);
                        }
                
                        $tests->logPathStats($path);
@@ -579,5 +589,7 @@ namespace {
                
                $tests->logStats();
        }
+
+       die($retval);
 }
 ?>