summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-05-22 20:22:53 +0200
committerRobin Appelman <icewind@owncloud.com>2012-05-22 20:22:53 +0200
commit60fdc13ae60a4d1bb62cbf29a8ab4b5ac1159709 (patch)
treeffa7d3e4e133da17c08106048088bf8c1e147d89 /tests
parent27f7dae9325a00ca19a25d56370729b475c5946e (diff)
downloadnextcloud-server-60fdc13ae60a4d1bb62cbf29a8ab4b5ac1159709.tar.gz
nextcloud-server-60fdc13ae60a4d1bb62cbf29a8ab4b5ac1159709.zip
enable running unit tests from cli
Diffstat (limited to 'tests')
-rw-r--r--tests/index.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/index.php b/tests/index.php
index 6dec1b050fb..9c5178f81a8 100644
--- a/tests/index.php
+++ b/tests/index.php
@@ -38,7 +38,13 @@ foreach($apps as $app){
}
function loadTests($dir=''){
- $test=isset($_GET['test'])?$_GET['test']:false;
+ if(OC::$CLI){
+ $reporter='TextReporter';
+ $test=isset($_SERVER['argv'][1])?$_SERVER['argv'][1]:false;
+ }else{
+ $reporter='HtmlReporter';
+ $test=isset($_GET['test'])?$_GET['test']:false;
+ }
if($dh=opendir($dir)){
while($name=readdir($dh)){
if(substr($name,0,1)!='.'){//no hidden files, '.' or '..'
@@ -51,7 +57,7 @@ function loadTests($dir=''){
$testCase=new TestSuite($name);
$testCase->addFile($file);
if($testCase->getSize()>0){
- $testCase->run(new HtmlReporter());
+ $testCase->run(new $reporter());
}
}
}