diff options
author | Felipe Pena <felipe@php.net> | 2008-11-03 13:07:28 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2008-11-03 13:07:28 +0000 |
commit | ade487e69380ae8d2bcac4afe6d8766cfb988dba (patch) | |
tree | 459dcd500cab5056ff67f356eff026467b923a34 | |
parent | 963abc546df33c01344e5b925fd1a3d5201968b3 (diff) | |
download | php-git-ade487e69380ae8d2bcac4afe6d8766cfb988dba.tar.gz |
- Opss, reverted accidental changes
-rw-r--r-- | ext/pcre/tests/007.phpt | 6 | ||||
-rw-r--r-- | ext/pcre/tests/backtrack_limit.phpt | 6 | ||||
-rw-r--r-- | ext/pcre/tests/bug27103.phpt | 6 | ||||
-rw-r--r-- | ext/pcre/tests/invalid_utf8.phpt | 6 | ||||
-rw-r--r-- | ext/pcre/tests/invalid_utf8_offset.phpt | 6 | ||||
-rw-r--r-- | ext/pcre/tests/locales.phpt | 7 | ||||
-rw-r--r-- | ext/pcre/tests/pcre_anchored.phpt | 6 | ||||
-rw-r--r-- | ext/pcre/tests/preg_replace2.phpt | 6 | ||||
-rw-r--r-- | ext/pcre/tests/recursion_limit.phpt | 6 | ||||
-rwxr-xr-x | 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 97d4633a12..776bec27b2 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-- +<?php +if (@preg_match('/./u', '') === false) { + die('skip no utf8 support in PCRE library'); +} +?> --FILE-- <?php diff --git a/ext/pcre/tests/backtrack_limit.phpt b/ext/pcre/tests/backtrack_limit.phpt index ebfd720c3c..517e727016 100644 --- a/ext/pcre/tests/backtrack_limit.phpt +++ b/ext/pcre/tests/backtrack_limit.phpt @@ -1,5 +1,11 @@ --TEST-- Backtracking limit +--SKIPIF-- +<?php +if (@preg_match_all('/\p{N}/', '0123456789', $dummy) === false) { + die("skip no support for \p support PCRE library"); +} +?> --INI-- pcre.backtrack_limit=2 --FILE-- diff --git a/ext/pcre/tests/bug27103.phpt b/ext/pcre/tests/bug27103.phpt index 185225d310..163dc9f1ea 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-- +<?php +if (@preg_match('/./u', '') === false) { + die('skip no utf8 support in PCRE library'); +} +?> --FILE-- <?php function iter($ar) diff --git a/ext/pcre/tests/invalid_utf8.phpt b/ext/pcre/tests/invalid_utf8.phpt index df2de2da9b..56bad834dc 100644 --- a/ext/pcre/tests/invalid_utf8.phpt +++ b/ext/pcre/tests/invalid_utf8.phpt @@ -1,5 +1,11 @@ --TEST-- preg_replace() and invalid UTF8 +--SKIPIF-- +<?php +if (@preg_match('/./u', '') === false) { + die('skip no utf8 support in PCRE library'); +} +?> --FILE-- <?php diff --git a/ext/pcre/tests/invalid_utf8_offset.phpt b/ext/pcre/tests/invalid_utf8_offset.phpt index 30fe7029da..4e0d40caf4 100644 --- a/ext/pcre/tests/invalid_utf8_offset.phpt +++ b/ext/pcre/tests/invalid_utf8_offset.phpt @@ -1,5 +1,11 @@ --TEST-- preg_replace() and invalid UTF8 offset +--SKIPIF-- +<?php +if (@preg_match('/./u', '') === false) { + die('skip no utf8 support in PCRE library'); +} +?> --FILE-- <?php diff --git a/ext/pcre/tests/locales.phpt b/ext/pcre/tests/locales.phpt index 647c0d8f7e..a1030204ee 100644 --- a/ext/pcre/tests/locales.phpt +++ b/ext/pcre/tests/locales.phpt @@ -1,5 +1,12 @@ --TEST-- Localized match +--SKIPIF-- +<?php + +if (!function_exists('setlocale')) die('skip: setlocale() not available'); +if (!@setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese')) die('skip pt locale not available'); + +?> --FILE-- <?php diff --git a/ext/pcre/tests/pcre_anchored.phpt b/ext/pcre/tests/pcre_anchored.phpt index caa96437e1..a609fdbdcd 100644 --- a/ext/pcre/tests/pcre_anchored.phpt +++ b/ext/pcre/tests/pcre_anchored.phpt @@ -1,5 +1,11 @@ --TEST-- A (PCRE_ANCHORED) modififer +--SKIPIF-- +<?php +if (@preg_match_all('/\p{N}/', '0123456789', $dummy) === false) { + die("skip no support for \p support PCRE library"); +} +?> --FILE-- <?php diff --git a/ext/pcre/tests/preg_replace2.phpt b/ext/pcre/tests/preg_replace2.phpt index 4e2f39f8ca..4a191f3331 100644 --- a/ext/pcre/tests/preg_replace2.phpt +++ b/ext/pcre/tests/preg_replace2.phpt @@ -1,5 +1,11 @@ --TEST-- preg_replace() +--SKIPIF-- +<?php +if (@preg_match('/./u', '') === false) { + die('skip no utf8 support in PCRE library'); +} +?> --FILE-- <?php diff --git a/ext/pcre/tests/recursion_limit.phpt b/ext/pcre/tests/recursion_limit.phpt index 2a43aa27d6..9933b5c4d7 100644 --- a/ext/pcre/tests/recursion_limit.phpt +++ b/ext/pcre/tests/recursion_limit.phpt @@ -1,5 +1,11 @@ --TEST-- PCRE Recursion limit +--SKIPIF-- +<?php +if (@preg_match_all('/\p{N}/', '0123456789', $dummy) === false) { + die("skip no support for \p support PCRE library"); +} +?> --INI-- pcre.recursion_limit=2 --FILE-- diff --git a/run-tests.php b/run-tests.php index a5a5235fbd..b135e617f8 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 = '<?php '; - foreach ($ini[$label]['skip'] as $skip_file) { - $code .= 'require_once "'. $skip_file .'";'; - } - $skip_codes[$label] = $code; + + if (array_key_exists('SKIPIF', $section_text)) { + + if (trim($section_text['SKIPIF'])) { + show_file_block('skip', $section_text['SKIPIF']); + save_text($test_skipif, $section_text['SKIPIF'], $temp_skipif); + $extra = substr(PHP_OS, 0, 3) !== "WIN" ? + "unset REQUEST_METHOD; unset QUERY_STRING; unset PATH_TRANSLATED; unset SCRIPT_FILENAME; unset REQUEST_METHOD;": ""; + + if ($leak_check) { + $env['USE_ZEND_ALLOC'] = '0'; + } else { + $env['USE_ZEND_ALLOC'] = '1'; } - } - } - if (isset($section_text['SKIPIF']) && trim($section_text['SKIPIF'])) { - $skip_codes[] = $section_text['SKIPIF']; - } - - $env['USE_ZEND_ALLOC'] = $leak_check ? '0' : '1'; - $extra = substr(PHP_OS, 0, 3) !== "WIN" ? - "unset REQUEST_METHOD; unset QUERY_STRING; unset PATH_TRANSLATED; unset SCRIPT_FILENAME; unset REQUEST_METHOD;": ""; - - if (!empty($skip_codes)) { - foreach ($skip_codes as $label => $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; |