Commit:    b3d8d59065990541c66cad5e84ba0d0c836684c2
Author:    zoe slattery <z...@php.net>         Tue, 9 Oct 2012 14:57:59 +0100
Parents:   5bfcd27d56f557e23760435c4fd0ca83f6d077ba
Branches:  master

Link:       
http://git.php.net/?p=phpruntests.git;a=commitdiff;h=b3d8d59065990541c66cad5e84ba0d0c836684c2

Log:
Changes to add default test directories (running from make test)

Changed paths:
  M  src/configuration/rtCommandLineOptions.php
  M  src/run-tests.php
  M  src/testrun/rtPhpTestRun.php


Diff:
diff --git a/src/configuration/rtCommandLineOptions.php 
b/src/configuration/rtCommandLineOptions.php
index 58188eb..eec5f39 100644
--- a/src/configuration/rtCommandLineOptions.php
+++ b/src/configuration/rtCommandLineOptions.php
@@ -158,6 +158,13 @@ class rtCommandLineOptions
             $i++;
             $this->options[$option] = $argv[$i];
         }
+        
+        if(empty($this->testFilename)) {
+               //set default options if being run from PHP top level directory 
(as in make test)
+               if(file_exists(getcwd() . "/" . "sapi/cli/php")) {
+                       $this->testFilename = array('tests', 'ext', 'Zend', 
'ZendEngine2', 'sapi/cli', 'sapi/cgi');
+               }
+        }
     }
 
     /**
diff --git a/src/run-tests.php b/src/run-tests.php
index 3d11d00..3adb55f 100644
--- a/src/run-tests.php
+++ b/src/run-tests.php
@@ -33,6 +33,7 @@ if (version_compare(PHP_VERSION, '5.3.0RC1', '<')) {
 require_once dirname(__FILE__) . '/rtAutoload.php';
 
 $s = microtime(true);
+var_dump($argv);
 
 $phpTestRun = new rtPhpTestRun($argv);
 $phpTestRun->run();
diff --git a/src/testrun/rtPhpTestRun.php b/src/testrun/rtPhpTestRun.php
index d42094c..2850d33 100644
--- a/src/testrun/rtPhpTestRun.php
+++ b/src/testrun/rtPhpTestRun.php
@@ -314,6 +314,11 @@ class rtPhpTestRun
                } else if 
($this->runConfiguration->hasCommandLineOption('vvv')) {
                        $this->reportStatus = 3;
                }
+               
+               //Set the default for runs from 'make test'
+               if ( file_exists(getcwd() . "/sapi/cli/php")) {
+                       $this->reportStatus = 1;
+               }
        }
        
 }


--
PHP Quality Assurance Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to