From: krakjoe Date: Thu, 5 Dec 2013 12:23:49 +0000 (+0000) Subject: add moar X-Git-Tag: php-5.6.0alpha1~110^2~29^2~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6fc2ed61c4299dcc0dbfe36ab160a62f18880669;p=php add moar --- diff --git a/tests/code/class.php b/tests/code/class.php new file mode 100644 index 0000000000..84efca97d4 --- /dev/null +++ b/tests/code/class.php @@ -0,0 +1,8 @@ + diff --git a/tests/basic.test b/tests/commands/0001_basic.test similarity index 100% rename from tests/basic.test rename to tests/commands/0001_basic.test diff --git a/tests/set.test b/tests/commands/0002_set.test similarity index 100% rename from tests/set.test rename to tests/commands/0002_set.test diff --git a/tests/commands/0100_compile.test b/tests/commands/0100_compile.test new file mode 100644 index 0000000000..9b71e04ddf --- /dev/null +++ b/tests/commands/0100_compile.test @@ -0,0 +1,13 @@ +################################################# +# name: compile +# purpose: test pre-compilation +# expect: TEST::CISTRING +# options: -rr +################################################# +# set execution context +# attempting compilation +# success +################################################# +exec sapi/phpdbg/tests/code/class.php +compile +q diff --git a/tests/commands/0101_info.test b/tests/commands/0101_info.test new file mode 100644 index 0000000000..efacd379a5 --- /dev/null +++ b/tests/commands/0101_info.test @@ -0,0 +1,17 @@ +################################################# +# name: info +# purpose: test info commands +# expect: TEST::CISTRING +# options: -rr +################################################# +# set execution context +# attempting compilation +# success +# user classes +# user class test +# |---- in +################################################# +exec sapi/phpdbg/tests/code/class.php +compile +info classes +q diff --git a/tests/run-tests.php b/tests/run-tests.php index 397e91a8ae..e3f26c28eb 100644 --- a/tests/run-tests.php +++ b/tests/run-tests.php @@ -152,25 +152,31 @@ namespace phpdbg\testing { * @param string the path to log */ public function logPathStats($path) { + if (!isset($this->stats[$path])) { + return; + } + $total = array_sum($this->stats[$path]); - @$this->totals[true] += $this->stats[$path][true]; - @$this->totals[false] += $this->stats[$path][false]; + if ($total) { + @$this->totals[true] += $this->stats[$path][true]; + @$this->totals[false] += $this->stats[$path][false]; - $stats = @sprintf( - "%d/%d %%%d", - $this->stats[$path][true], - $this->stats[$path][false], - (100 / $total) * $this->stats[$path][true]); + $stats = @sprintf( + "%d/%d %%%d", + $this->stats[$path][true], + $this->stats[$path][false], + (100 / $total) * $this->stats[$path][true]); - printf( - '%s [%s]%s', - str_repeat( - ' ', $this->config['width'] - strlen($stats)), - $stats, PHP_EOL); + printf( + '%s [%s]%s', + str_repeat( + ' ', $this->config['width'] - strlen($stats)), + $stats, PHP_EOL); - printf("%s%s", str_repeat('-', $this->config['width']+3), PHP_EOL); - printf("%s", PHP_EOL); + printf("%s%s", str_repeat('-', $this->config['width']+3), PHP_EOL); + printf("%s", PHP_EOL); + } } /**