cvs: php-benchmarks /benchcli bench.php
| From: | Alexander Hjalmarsson | Date: | Tue, 23 Jun 2009 00:02:23 +0000 |
| Subject: | cvs: php-benchmarks /benchcli bench.php | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-65126@lists.php.net to get a copy of this message | ||
hjalle Tue Jun 23 00:02:23 2009 UTC
Modified files:
/php-benchmarks/benchcli bench.php
Log:
Changed include set path instead of just including. Ie, if paths is set, it will be only those
paths that are included and the default ones will not automatically be when the argument is set.
microtests has also been added to the default test set.
http://cvs.php.net/viewvc.cgi/php-benchmarks/benchcli/bench.php?r1=1.4&r2=1.5&diff_format=u
Index: php-benchmarks/benchcli/bench.php
diff -u php-benchmarks/benchcli/bench.php:1.4 php-benchmarks/benchcli/bench.php:1.5
--- php-benchmarks/benchcli/bench.php:1.4 Wed Jun 17 14:43:16 2009
+++ php-benchmarks/benchcli/bench.php Tue Jun 23 00:02:23 2009
@@ -48,7 +48,7 @@
* Directories to search for php test files.
* @var array
*/
- var $include;
+ var $paths;
/**
* Path to the php binary
@@ -123,16 +123,19 @@
if ($this->memory_limit == "") {
$this->memory_limit = 128;
}
- $this->include = $args->getValue('include');
- if (is_array($this->include)) {
- $this->include[] = "tests"; // Append default directory
- } else {
+ $this->paths = $args->getValue('path');
+ if (is_string($this->paths)) {
//user has one directory as input, therefore
- //$this->include is recognized as a string
- $tmpdir = $this->include;
- $this->include = array();
- $this->include[] = $tmpdir;
- $this->include[] = "tests";
+ //$this->paths is recognized as a string
+ $tmpdir = $this->paths;
+ $this->paths = array();
+ $this->paths[] = $tmpdir;
+ } else if (empty($this->paths)) {
+ //There are no included directories
+ //Let's add the default ones
+ $this->paths = array();
+ $this->paths[] = "tests";
+ $this->paths[] = "microtests";
}
$this->php = $args->getValue('php');
if ($this->php == "") {
@@ -183,9 +186,10 @@
'debug' => array('short' => 'd',
'max' => 0,
'desc' => 'Switch to debug mode.'),
- 'include' => array('min' => 0,
+ 'path ' => array('min' => 0,
'max' => -1,
- 'desc' => 'Include additional test directories'),
+ 'desc' => 'Path/paths to php test files',
+ 'default' => 'microtests, tests'),
'help' => array('short' => 'h',
'max' => 0,
'desc' => 'Print this help message'),
@@ -245,7 +249,7 @@
function setTestFiles()
{
$files = array();
- foreach ($this->include as $dir) {
+ foreach ($this->paths as $dir) {
foreach (glob("$dir/test_*.php") as $filename) {
$t['filename'] = $filename;
preg_match('/test_(.+)[.]php$/i', $filename, $matches);