derick                                   Tue, 06 Dec 2011 05:44:54 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=320475

Log:
This changes adds the --EXTENSION-- section to .phpt files as
described in http://marc.info/?t=132248616300007&r=1&w=2.

Changed paths:
    U   php/php-src/branches/PHP_5_3/run-tests.php
    U   php/php-src/branches/PHP_5_4/run-tests.php
    U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===================================================================
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-12-06 02:18:08 UTC (rev 
320474)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-12-06 05:44:54 UTC (rev 
320475)
@@ -1246,7 +1246,7 @@
                }

                // Match the beginning of a section.
-               if (preg_match(b'/^--([_A-Z]+)--/', $line, $r)) {
+               if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
                        $section = $r[1];
                        settype($section, 'string');

@@ -1483,6 +1483,18 @@
                settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), 
$ini_settings);
        }

+       // Additional required extensions
+       if (array_key_exists('EXTENSIONS', $section_text)) {
+               $ext_dir=`$php -r 'echo ini_get("extension_dir");'`;
+               $extensions = preg_split("/[\n\r]+/", 
trim($section_text['EXTENSIONS']));
+               $loaded = explode(",", `$php -n -r 'echo join(",", 
get_loaded_extensions());'`);
+               foreach ($extensions as $req_ext) {
+                       if (!in_array($req_ext, $loaded)) {
+                               $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+                       }
+               }
+       }
+
        settings2params($ini_settings);

        // Check if test should be skipped.

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===================================================================
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-12-06 02:18:08 UTC (rev 
320474)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-12-06 05:44:54 UTC (rev 
320475)
@@ -1246,7 +1246,7 @@
                }

                // Match the beginning of a section.
-               if (preg_match(b'/^--([_A-Z]+)--/', $line, $r)) {
+               if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
                        $section = $r[1];
                        settype($section, 'string');

@@ -1483,6 +1483,18 @@
                settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), 
$ini_settings);
        }

+       // Additional required extensions
+       if (array_key_exists('EXTENSIONS', $section_text)) {
+               $ext_dir=`$php -r 'echo ini_get("extension_dir");'`;
+               $extensions = preg_split("/[\n\r]+/", 
trim($section_text['EXTENSIONS']));
+               $loaded = explode(",", `$php -n -r 'echo join(",", 
get_loaded_extensions());'`);
+               foreach ($extensions as $req_ext) {
+                       if (!in_array($req_ext, $loaded)) {
+                               $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+                       }
+               }
+       }
+
        settings2params($ini_settings);

        // Check if test should be skipped.

Modified: php/php-src/trunk/run-tests.php
===================================================================
--- php/php-src/trunk/run-tests.php     2011-12-06 02:18:08 UTC (rev 320474)
+++ php/php-src/trunk/run-tests.php     2011-12-06 05:44:54 UTC (rev 320475)
@@ -1483,6 +1483,18 @@
                settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), 
$ini_settings);
        }

+       // Additional required extensions
+       if (array_key_exists('EXTENSIONS', $section_text)) {
+               $ext_dir=`$php -r 'echo ini_get("extension_dir");'`;
+               $extensions = preg_split("/[\n\r]+/", 
trim($section_text['EXTENSIONS']));
+               $loaded = explode(",", `$php -n -r 'echo join(",", 
get_loaded_extensions());'`);
+               foreach ($extensions as $req_ext) {
+                       if (!in_array($req_ext, $loaded)) {
+                               $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+                       }
+               }
+       }
+
        settings2params($ini_settings);

        // Check if test should be skipped.

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to