From ade487e69380ae8d2bcac4afe6d8766cfb988dba Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Mon, 3 Nov 2008 13:07:28 +0000 Subject: [PATCH] - Opss, reverted accidental changes --- ext/pcre/tests/007.phpt | 6 ++ ext/pcre/tests/backtrack_limit.phpt | 6 ++ ext/pcre/tests/bug27103.phpt | 6 ++ ext/pcre/tests/invalid_utf8.phpt | 6 ++ ext/pcre/tests/invalid_utf8_offset.phpt | 6 ++ ext/pcre/tests/locales.phpt | 7 ++ ext/pcre/tests/pcre_anchored.phpt | 6 ++ ext/pcre/tests/preg_replace2.phpt | 6 ++ ext/pcre/tests/recursion_limit.phpt | 6 ++ run-tests.php | 89 ++++++------------------- 10 files changed, 74 insertions(+), 70 deletions(-) diff --git a/ext/pcre/tests/007.phpt b/ext/pcre/tests/007.phpt index 97d4633a122..776bec27b2c 100644 --- a/ext/pcre/tests/007.phpt +++ b/ext/pcre/tests/007.phpt @@ -1,5 +1,11 @@ --TEST-- preg_replace_callback() with callback that modifies subject string +--SKIPIF-- + --FILE-- --INI-- pcre.backtrack_limit=2 --FILE-- diff --git a/ext/pcre/tests/bug27103.phpt b/ext/pcre/tests/bug27103.phpt index 185225d3108..163dc9f1ea6 100644 --- a/ext/pcre/tests/bug27103.phpt +++ b/ext/pcre/tests/bug27103.phpt @@ -1,5 +1,11 @@ --TEST-- Bug #27103 (preg_split('//u') incorrectly splits UTF-8 strings into octets) +--SKIPIF-- + --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --INI-- pcre.recursion_limit=2 --FILE-- diff --git a/run-tests.php b/run-tests.php index a5a5235fbd8..b135e617f8d 100755 --- a/run-tests.php +++ b/run-tests.php @@ -814,24 +814,6 @@ foreach ($user_tests as $dir) { find_files($dir, ($dir == 'ext')); } -function find_ini_skip($path) -{ - $skip_dir = $path; - $cwd = getcwd(); - - do { - if (in_array(basename($skip_dir), array('Zend', 'ext', '')) || $skip_dir == $cwd) { - break; - } - $ini_skip_file = $skip_dir .'/skip.ini'; - if (file_exists($ini_skip_file)) { - return $ini_skip_file; - } - } while ($skip_dir = dirname($skip_dir)); - - return false; -} - function find_files($dir, $is_ext_dir = false, $ignore = false) { global $test_files, $exts_to_test, $ignored_by_ext, $exts_skipped, $exts_tested; @@ -1403,56 +1385,21 @@ TEST $file // Check if test should be skipped. $info = ''; $warn = false; - $skip_codes = array(); - - /* Using skip.ini */ - if ($skip_ini = find_ini_skip($file)) { - $ini = parse_ini_file($skip_ini, true); - - /* Skip on 32-bit architecture */ - if (PHP_INT_SIZE == 4 && isset($ini['SKIP_32']['test']) - && in_array(basename($file), $ini['SKIP_32']['test'])) { - show_result('SKIP', $tested, $tested_file, 'This test is for non 32-bit', $temp_filenames); - return 'SKIPPED'; - } - /* Skip on 64-bit architecture */ - if (PHP_INT_SIZE != 4 && isset($ini['SKIP_64']['test']) - && in_array(basename($file), $ini['SKIP_64']['test'])) { - show_result('SKIP', $tested, $tested_file, 'This test is for 32-bit only', $temp_filenames); - return 'SKIPPED'; - } - $labels = array_keys($ini); - foreach ($labels as $label) { - if (in_array($label, array('SKIP_32', 'SKIP_64'))) { - continue; - } - if (isset($ini[$label]['skip']) && isset($ini[$label]['test'])) { - if (!in_array(basename($file), $ini[$label]['test'])) { - continue; - } - $code = ' $code) { - show_file_block('skip', $code); - save_text($test_skipif, $code, $temp_skipif); - $output = system_with_timeout("$extra $php $pass_options -q $ini_settings $test_skipif", $env); if (!$cfg['keep']['skip']) { @@ -1460,10 +1407,12 @@ TEST $file } if (!strncasecmp('skip', ltrim($output), 4)) { - preg_match('/^\s*skip\s*(.+)\s*/i', $output, $m); - - $reason = (is_string($label) && empty($m)) ? $label : (empty($m) ? 'not specified' : $m[1]); - show_result('SKIP', $tested, $tested_file, 'reason: '. $reason, $temp_filenames); + + if (preg_match('/^\s*skip\s*(.+)\s*/i', $output, $m)) { + show_result('SKIP', $tested, $tested_file, "reason: $m[1]", $temp_filenames); + } else { + show_result('SKIP', $tested, $tested_file, '', $temp_filenames); + } if (isset($old_php)) { $php = $old_php;