本文整理汇总了PHP中show_test函数的典型用法代码示例。如果您正苦于以下问题:PHP show_test函数的具体用法?PHP show_test怎么用?PHP show_test使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了show_test函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run_test
//.........这里部分代码省略.........
$php = realpath("./sapi/cgi/php-cgi") . ' -C ';
} else {
if (file_exists(dirname($php) . "/php-cgi")) {
$old_php = $php;
$php = realpath(dirname($php) . "/php-cgi") . ' -C ';
} else {
show_result('SKIP', $tested, $tested_file, "reason: CGI not available");
junit_init_suite(junit_get_suitename_for($shortname));
junit_mark_test_as('SKIP', $shortname, $tested, 0, 'CGI not available');
return 'SKIPPED';
}
}
}
}
}
$uses_cgi = true;
}
/* For phpdbg tests, check if phpdbg sapi is available and if it is, use it. */
if (array_key_exists('PHPDBG', $section_text)) {
if (!isset($section_text['STDIN'])) {
$section_text['STDIN'] = $section_text['PHPDBG'] . "\n";
}
if (isset($phpdbg)) {
$old_php = $php;
$php = $phpdbg . ' -qIb';
} else {
show_result('SKIP', $tested, $tested_file, "reason: phpdbg not available");
junit_init_suite(junit_get_suitename_for($shortname));
junit_mark_test_as('SKIP', $shortname, $tested, 0, 'phpdbg not available');
return 'SKIPPED';
}
}
if (!$SHOW_ONLY_GROUPS) {
show_test($test_idx, $shortname);
}
if (is_array($IN_REDIRECT)) {
$temp_dir = $test_dir = $IN_REDIRECT['dir'];
} else {
$temp_dir = $test_dir = realpath(dirname($file));
}
if ($temp_source && $temp_target) {
$temp_dir = str_replace($temp_source, $temp_target, $temp_dir);
}
$main_file_name = basename($file, 'phpt');
$diff_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'diff';
$log_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'log';
$exp_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'exp';
$output_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'out';
$memcheck_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'mem';
$sh_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'sh';
$temp_file = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
$test_file = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
$temp_skipif = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php';
$test_skipif = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php';
$temp_clean = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'clean.php';
$test_clean = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'clean.php';
$tmp_post = $temp_dir . DIRECTORY_SEPARATOR . uniqid('/phpt.');
$tmp_relative_file = str_replace(__DIR__ . DIRECTORY_SEPARATOR, '', $test_file) . 't';
if ($temp_source && $temp_target) {
$temp_skipif .= 's';
$temp_file .= 's';
$temp_clean .= 's';
$copy_file = $temp_dir . DIRECTORY_SEPARATOR . basename(is_array($file) ? $file[1] : $file) . '.phps';
if (!is_dir(dirname($copy_file))) {
mkdir(dirname($copy_file), 0777, true) or error("Cannot create output directory - " . dirname($copy_file));
}
示例2: run_test
//.........这里部分代码省略.........
$shortname = str_replace($cwd . '/', '', $file);
$tested_file = $shortname;
if ($borked) {
show_result("BORK", $bork_info, $tested_file);
$PHP_FAILED_TESTS['BORKED'][] = array('name' => $file, 'test_name' => '', 'output' => '', 'diff' => '', 'info' => "{$bork_info} [{$file}]");
return 'BORKED';
}
$tested = trim($section_text['TEST']);
/* For GET/POST tests, check if cgi sapi is available and if it is, use it. */
if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
} else {
if (!strncasecmp(PHP_OS, "win", 3) && file_exists(dirname($php) . "/php-cgi.exe")) {
$old_php = $php;
$php = realpath(dirname($php) . "/php-cgi.exe") . ' -C ';
} else {
if (file_exists(dirname($php) . "/../../sapi/cgi/php-cgi")) {
$old_php = $php;
$php = realpath(dirname($php) . "/../../sapi/cgi/php-cgi") . ' -C ';
} else {
if (file_exists("./sapi/cgi/php-cgi")) {
$old_php = $php;
$php = realpath("./sapi/cgi/php-cgi") . ' -C ';
} else {
show_result('SKIP', $tested, $tested_file, "reason: CGI not available");
return 'SKIPPED';
}
}
}
}
}
show_test($test_idx, $shortname);
if (is_array($IN_REDIRECT)) {
$temp_dir = $test_dir = $IN_REDIRECT['dir'];
} else {
$temp_dir = $test_dir = realpath(dirname($file));
}
if ($temp_source && $temp_target) {
$temp_dir = str_replace($temp_source, $temp_target, $temp_dir);
}
$main_file_name = basename($file, 'phpt');
$diff_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'diff';
$log_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'log';
$exp_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'exp';
$output_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'out';
$memcheck_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'mem';
$temp_file = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
$test_file = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
$temp_skipif = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php';
$test_skipif = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php';
$temp_clean = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'clean.php';
$test_clean = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'clean.php';
$tmp_post = $temp_dir . DIRECTORY_SEPARATOR . uniqid('/phpt.');
$tmp_relative_file = str_replace(realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR, '', $test_file) . 't';
if ($temp_source && $temp_target) {
$temp_skipif .= 's';
$temp_file .= 's';
$temp_clean .= 's';
$copy_file = $temp_dir . DIRECTORY_SEPARATOR . basename(is_array($file) ? $file[1] : $file) . '.phps';
if (!is_dir(dirname($copy_file))) {
mkdir(dirname($copy_file), 0777, true) or error("Cannot create output directory - " . dirname($copy_file));
}
if (isset($section_text['FILE'])) {
save_text($copy_file, $section_text['FILE']);
示例3: run_test
//.........这里部分代码省略.........
$section_text['FILE'] = preg_replace("/[\r\n]+\$/", '', $section_text['FILEEOF']);
unset($section_text['FILEEOF']);
}
if (@count($section_text['EXPECT']) + @count($section_text['EXPECTF']) + @count($section_text['EXPECTREGEX']) != 1) {
$bork_info = "missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX--";
$borked = true;
}
}
fclose($fp);
$shortname = str_replace($cwd . '/', '', $file);
$tested_file = $shortname;
if ($borked) {
show_result("BORK", $bork_info, $tested_file);
$PHP_FAILED_TESTS['BORKED'][] = array('name' => $file, 'test_name' => '', 'output' => '', 'diff' => '', 'info' => "{$bork_info} [{$file}]");
return 'BORKED';
}
$tested = trim($section_text['TEST']);
/* For GET/POST tests, check if cgi sapi is available and if it is, use it. */
if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
} elseif (!strncasecmp(PHP_OS, "win", 3) && file_exists(dirname($php) . "/php-cgi.exe")) {
$old_php = $php;
$php = realpath(dirname($php) . "/php-cgi.exe") . ' -C ';
} elseif (file_exists("./sapi/cgi/php")) {
$old_php = $php;
$php = realpath("./sapi/cgi/php") . ' -C ';
} else {
show_result("SKIP", $tested, $tested_file, "reason: CGI not available");
return 'SKIPPED';
}
}
show_test($test_idx, $shortname);
if (is_array($IN_REDIRECT)) {
$temp_dir = $test_dir = $IN_REDIRECT['dir'];
} else {
$temp_dir = $test_dir = realpath(dirname($file));
}
if ($temp_source && $temp_target) {
$temp_dir = str_replace($temp_source, $temp_target, $temp_dir);
}
$main_file_name = basename($file, 'phpt');
$diff_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'diff';
$log_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'log';
$exp_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'exp';
$output_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'out';
$memcheck_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'mem';
$temp_file = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
$test_file = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
$temp_skipif = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php';
$test_skipif = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php';
$temp_clean = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'clean.php';
$test_clean = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'clean.php';
$tmp_post = $temp_dir . DIRECTORY_SEPARATOR . uniqid('/phpt.');
$tmp_relative_file = str_replace(dirname(__FILE__) . DIRECTORY_SEPARATOR, '', $test_file) . 't';
if ($temp_source && $temp_target) {
$temp_skipif .= 's';
$temp_file .= 's';
$temp_clean .= 's';
$copy_file = $temp_dir . DIRECTORY_SEPARATOR . basename(is_array($file) ? $file[1] : $file) . '.phps';
if (!is_dir(dirname($copy_file))) {
@mkdir(dirname($copy_file), 0777, true) or error("Cannot create output directory - " . dirname($copy_file));
}
if (isset($section_text['FILE'])) {
save_text($copy_file, $section_text['FILE']);