diff options
author | Derick Rethans <derick@php.net> | 2011-12-06 05:44:54 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2011-12-06 05:44:54 +0000 |
commit | 0dcf098efdac2e5d06220fcd74cf6bd153d0ec5d (patch) | |
tree | 6980382e9c3ac648b741ddacc593ed9da644e857 /run-tests.php | |
parent | a204f8fcfd9818e7e4dec8d87c9e962e2cbb4acb (diff) | |
download | php-git-0dcf098efdac2e5d06220fcd74cf6bd153d0ec5d.tar.gz |
This changes adds the --EXTENSION-- section to .phpt files as
described in http://marc.info/?t=132248616300007&r=1&w=2.
Diffstat (limited to 'run-tests.php')
-rwxr-xr-x | run-tests.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/run-tests.php b/run-tests.php index 3fba338dca..3e22a9556e 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1246,7 +1246,7 @@ TEST $file } // 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 @@ TEST $file 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. |