Пример #1
0
 function &getPluginGroupTestList($directory = '.')
 {
     $manager = new CLITestManager();
     $test_cases =& $manager->_getTestGroupList($directory);
     $buffer = "Available test cases:\n";
     foreach ($test_cases as $test_case) {
         $buffer .= "  " . $test_case . "\n";
     }
     return $buffer . "\n";
 }
Пример #2
0
            case 'path':
                if (file_exists($option[1])) {
                    define('SIMPLE_TEST', $option[1]);
                }
                break;
        }
    }
}
if (!@(include_once SIMPLE_TEST . 'runner.php')) {
    error('runtime', 'LIBRARY_REQUIRED', array('library' => 'Simple Test', 'path' => SIMPLE_TEST));
}
require_once LIMB_DIR . '/tests/lib/cli_reporter.php';
/* list grouptests */
if ($opt_list) {
    echo CLITestManager::getGroupTestList(TEST_GROUPS_DIR);
    echo CLITestManager::getTestCaseList(TEST_CASES_DIR);
    exit(0);
}
/* run a test case */
if ($opt_casefile) {
    TestManager::runTestCase($opt_casefile, new CLIReporter($opt_separator));
    echo debug::parse_cli_console();
    exit(0);
}
/* run a grouptest */
if ($opt_groupfile) {
    TestManager::runGroupTest($opt_groupfile, TEST_GROUPS_DIR, new CLIReporter($opt_separator));
    echo debug::parse_cli_console();
    exit(0);
}
/* run all tests */
Пример #3
0
require_once 'lib/cli_reporter.php';
/* list grouptests */
if ($opt_grouplist) {
    echo CLITestManager::getGroupTestList(TEST_GROUPS);
}
/* list test cases */
if ($opt_caselist) {
    echo CLITestManager::getTestCaseList(TEST_CASES);
}
/* list plugin test cases */
if ($opt_plugincaselist) {
    echo CLITestManager::getPluginTestCaseList(TEST_PLUGINS);
}
/* list plugin group tests */
if ($opt_plugingrouplist) {
    echo CLITestManager::getPluginGroupTestList(TEST_PLUGINS);
}
/* exit if we've displayed a list */
if ($opt_grouplist || $opt_caselist || $opt_plugincaselist || $opt_plugingrouplist) {
    exit(0);
}
/* run a test case */
if ($opt_casefile) {
    TestManager::runTestFile($opt_casefile, new CLIReporter($opt_separator));
    exit(0);
}
/* run a test case by id */
if ($opt_caseid) {
    TestManager::runTestCase($opt_caseid, TEST_CASES, new CLIReporter($opt_separator));
    exit(0);
}