allow running a single test or group of tests
This commit is contained in:
parent
08b4f996d3
commit
f42897344f
|
@ -38,6 +38,7 @@ foreach($apps as $app){
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadTests($dir=''){
|
function loadTests($dir=''){
|
||||||
|
$test=isset($_GET['test'])?$_GET['test']:false;
|
||||||
if($dh=opendir($dir)){
|
if($dh=opendir($dir)){
|
||||||
while($name=readdir($dh)){
|
while($name=readdir($dh)){
|
||||||
if(substr($name,0,1)!='.'){//no hidden files, '.' or '..'
|
if(substr($name,0,1)!='.'){//no hidden files, '.' or '..'
|
||||||
|
@ -45,10 +46,13 @@ function loadTests($dir=''){
|
||||||
if(is_dir($file)){
|
if(is_dir($file)){
|
||||||
loadTests($file);
|
loadTests($file);
|
||||||
}elseif(substr($file,-4)=='.php' and $file!=__FILE__){
|
}elseif(substr($file,-4)=='.php' and $file!=__FILE__){
|
||||||
$testCase=new TestSuite(getTestName($file));
|
$name=getTestName($file);
|
||||||
$testCase->addFile($file);
|
if($test===false or $test==$name or substr($name,0,strlen($test))==$test){
|
||||||
if($testCase->getSize()>0){
|
$testCase=new TestSuite($name);
|
||||||
$testCase->run(new HtmlReporter());
|
$testCase->addFile($file);
|
||||||
|
if($testCase->getSize()>0){
|
||||||
|
$testCase->run(new HtmlReporter());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue