]> granicus.if.org Git - php/commitdiff
- Opss, reverted accidental changes
authorFelipe Pena <felipe@php.net>
Mon, 3 Nov 2008 13:07:28 +0000 (13:07 +0000)
committerFelipe Pena <felipe@php.net>
Mon, 3 Nov 2008 13:07:28 +0000 (13:07 +0000)
ext/pcre/tests/007.phpt
ext/pcre/tests/backtrack_limit.phpt
ext/pcre/tests/bug27103.phpt
ext/pcre/tests/invalid_utf8.phpt
ext/pcre/tests/invalid_utf8_offset.phpt
ext/pcre/tests/locales.phpt
ext/pcre/tests/pcre_anchored.phpt
ext/pcre/tests/preg_replace2.phpt
ext/pcre/tests/recursion_limit.phpt
run-tests.php

index 97d4633a122f570897a084f0d0a0bd43be458841..776bec27b2c7f87c7e8b8c5f40fad1dec3c04752 100644 (file)
@@ -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
 
index ebfd720c3cf063d0a9e77665bb3e15bca8001096..517e7270163969222d1adb26e98a2ab7d5f05ffe 100644 (file)
@@ -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--
index 185225d31082b908fcb384ccd47dd00e6994ff9c..163dc9f1ea6d7dcd30ed5faf9d4318064717bb01 100644 (file)
@@ -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)
index df2de2da9b3592c2a9e4fc74522641c282b3bd86..56bad834dc4e82699fb6b5de52025dc201ec0353 100644 (file)
@@ -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
 
index 30fe7029dad4a18b686df45baa21be8367b694d8..4e0d40caf41b222300eb29528fdc8a8f2ee2222f 100644 (file)
@@ -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
 
index 647c0d8f7e8b39fd30823c1d2b15e0d63c4b0205..a1030204eedd8b556dd54a72fa3591491a56979c 100644 (file)
@@ -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
 
index caa96437e19e79e5e331cbe5622682b2143e47df..a609fdbdcd64b0826831f0734bad22ba51af7d95 100644 (file)
@@ -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
 
index 4e2f39f8ca7b3e4d2d795a7add26f8305f6d101f..4a191f3331a8fc0261e3db691be7ec09a7255043 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 preg_replace()
+--SKIPIF--
+<?php
+if (@preg_match('/./u', '') === false) {
+       die('skip no utf8 support in PCRE library');
+}
+?>
 --FILE--
 <?php
 
index 2a43aa27d6bd69b13a9f518f23c0eea4bc141513..9933b5c4d780e1846ab7f2c25046b8c4ee60c721 100644 (file)
@@ -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--
index a5a5235fbd836571adb1d351d338c5d73ab5de4d..b135e617f8d3d842c6fd35170db5cc9530b29ff7 100755 (executable)
@@ -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;