summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-03-28 16:26:23 +0200
committerRobin Appelman <icewind@owncloud.com>2012-03-28 23:47:44 +0200
commitf42897344fd938edcdc955c0dd0094391f5df18a (patch)
treeaf2620318a277c8ae3207ed8e173345015447eb3 /tests
parent08b4f996d339fd4c7372f93850c8cea294f7ede5 (diff)
downloadnextcloud-server-f42897344fd938edcdc955c0dd0094391f5df18a.tar.gz
nextcloud-server-f42897344fd938edcdc955c0dd0094391f5df18a.zip
allow running a single test or group of tests
Diffstat (limited to 'tests')
-rw-r--r--tests/index.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/index.php b/tests/index.php
index 2e86366740b..a6f678b3bc2 100644
--- a/tests/index.php
+++ b/tests/index.php
@@ -38,6 +38,7 @@ foreach($apps as $app){
}
function loadTests($dir=''){
+ $test=isset($_GET['test'])?$_GET['test']:false;
if($dh=opendir($dir)){
while($name=readdir($dh)){
if(substr($name,0,1)!='.'){//no hidden files, '.' or '..'
@@ -45,10 +46,13 @@ function loadTests($dir=''){
if(is_dir($file)){
loadTests($file);
}elseif(substr($file,-4)=='.php' and $file!=__FILE__){
- $testCase=new TestSuite(getTestName($file));
- $testCase->addFile($file);
- if($testCase->getSize()>0){
- $testCase->run(new HtmlReporter());
+ $name=getTestName($file);
+ if($test===false or $test==$name or substr($name,0,strlen($test))==$test){
+ $testCase=new TestSuite($name);
+ $testCase->addFile($file);
+ if($testCase->getSize()>0){
+ $testCase->run(new HtmlReporter());
+ }
}
}
}