$parts = preg_split('/[.-]/', $name); if (!isset($group_list[$parts[0]])) { $group_list[$parts[0]] = array(); } $group_list[$parts[0]][] = array('link' => $test, 'name' => $name); } return $group_list; } function show_php($file) { $jade = new \Jade\Jade(true); return $jade->render($file); } mb_internal_encoding('utf-8'); error_reporting(E_ALL); setup_autoload(); $nav_list = build_list(find_tests()); foreach ($nav_list as $type => $arr) { foreach ($arr as $e) { if ($e['name'] == 'index' || isset($argv[1]) && $e['name'] != $argv[1] && $argv[1] != '.') { continue; } $html = @file_get_contents($e['name'] . '.html'); if ($html === FALSE) { print "! sample for test '{$e['name']}' not found.\n"; continue; } print "* rendering test '{$e['name']}'\n"; try { $new = show_php($e['name'] . '.jade'); } catch (Exception $err) {
function init_tests() { error_reporting(E_ALL); setup_autoload(); }
function init_tests() { mb_internal_encoding('utf-8'); error_reporting(E_ALL); setup_autoload(); }