Beispiel #1
0
$conf['lang'] = 'en';
define('TEST_ROOT', dirname(__FILE__));
define('TMPL_FILESCHEME_PATH', TEST_ROOT . '/filescheme/');
error_reporting(E_ALL);
set_time_limit(600);
ini_set('memory_limit', '128M');
/* Used to determine output to display */
define('DW_TESTS_OUTPUT_HTML', 1);
define('DW_TESTS_OUTPUT_XML', 2);
if (isset($_GET['output']) && $_GET['output'] == 'xml') {
    define('DW_TESTS_OUTPUT', DW_TESTS_OUTPUT_XML);
} else {
    define('DW_TESTS_OUTPUT', DW_TESTS_OUTPUT_HTML);
}
require_once 'lib/testmanager.php';
TestManager::setup('tests.ini');
if (!defined('SIMPLE_TEST')) {
    define('SIMPLE_TEST', ConfigManager::getOptionAsPath('tests', 'simpletest', 'library_path'));
}
if (!@(include_once SIMPLE_TEST . 'reporter.php')) {
    RaiseError('runtime', 'LIBRARY_REQUIRED', array('library' => 'Simple Test', 'path' => SIMPLE_TEST));
}
function &DW_TESTS_GetReporter()
{
    static $Reporter = NULL;
    if (!$Reporter) {
        switch (DW_TESTS_OUTPUT) {
            case DW_TESTS_OUTPUT_XML:
                require_once SIMPLE_TEST . 'xml.php';
                $Reporter = new XmlReporter();
                break;
Beispiel #2
0
#!/usr/bin/php -q
<?php 
ini_set('memory_limit', '128M');
if (!defined('DOKU_INC')) {
    define('DOKU_INC', realpath(dirname(__FILE__) . '/../') . '/');
}
define('DOKU_UNITTEST', true);
require_once DOKU_INC . 'inc/init.php';
require_once DOKU_INC . 'inc/events.php';
define('TEST_ROOT', dirname(__FILE__));
define('TMPL_FILESCHEME_PATH', TEST_ROOT . '/filescheme/');
error_reporting(E_ALL ^ E_NOTICE);
require_once 'lib/testmanager.php';
TestManager::setup();
function usage()
{
    $usage = <<<EOD
Usage: ./runtests.php [OPTION]...
Run the Dokuwiki unit tests. If ALL of the test cases pass a count of total
passes is printed on STDOUT. If ANY of the test cases fail (or raise
errors) details are printed on STDERR and this script returns a non-zero
exit code.
  -c  --case=NAME         specify a test case by it's ID (see -i for list)
  -f  --file=NAME         specify a test case file (full or relative path)
  -g  --group=NAME        specify a grouptest. If no grouptest is
                          specified, all test cases will be run.
  -i  --caselist          list individual test cases by their ID
  -l  --grouplist         list available grouptests
  -s, --separator=SEP     set the character(s) used to separate fail
                          details to SEP
  -p, --path              path to SimpleTest installation