Exemplo n.º 1
0
 function runGroupTest($group_name, &$reporter, $url = FALSE)
 {
     $groups = RemoteTestManager::getGroupTestList($url);
     if (!array_key_exists($group_name, $groups)) {
         trigger_error("Unknown group {$group_name}\n", E_USER_ERROR);
     }
     $T =& new RemoteTestCase($groups[$group_name]);
     $T->run($reporter);
 }
Exemplo n.º 2
0
 function &getTestCaseList($url = FALSE)
 {
     if (!$url) {
         $url = REMOTE_TEST_URL;
     }
     $url .= '?show=cases&output=xml';
     $manager = new RemoteTestManager();
     $rss =& $manager->_getRssReader($url);
     $caseList = array();
     foreach ($rss->getItems() as $item) {
         $caseList[$item['title']] = $item['link'];
     }
     return $caseList;
 }
Exemplo n.º 3
0
 function runGroupTest($groupName, &$reporter, $url = FALSE)
 {
     $groups = RemoteTestManager::getGroupTestList($url);
     $T =& new RemoteTestCase($groups[$groupName]);
     $T->run($reporter);
 }
Exemplo n.º 4
0
}
/* list test cases */
if ($opt_caselist) {
    $cases = RemoteTestManager::getTestCaseList($opt_url);
    fwrite(STDOUT, "Available tests tests:\n");
    foreach (array_keys($cases) as $case) {
        fwrite(STDOUT, $case . "\n");
    }
}
/* exit if we've displayed a list */
if ($opt_grouplist || $opt_caselist) {
    exit(0);
}
/* run a test case given it's URL */
if ($opt_caseurl) {
    RemoteTestManager::runTestUrl($opt_caseurl, new CLIReporter($opt_separator), $opt_url);
    exit(0);
}
/* run a test case by id*/
if ($opt_caseid) {
    RemoteTestManager::runTestCase($opt_caseid, new CLIReporter($opt_separator), $opt_url);
    exit(0);
}
/* run a grouptest */
if ($opt_groupfile) {
    RemoteTestManager::runGroupTest($opt_groupfile, new CLIReporter($opt_separator), $opt_url);
    exit(0);
}
/* run all tests */
RemoteTestManager::runAllTests(new CLIReporter($opt_separator), $opt_url);
exit(0);