Skip to content

Commit

Permalink
This changes adds the --EXTENSION-- section to .phpt files as
Browse files Browse the repository at this point in the history
  • Loading branch information
Derick Rethans committed Dec 6, 2011
1 parent 95784cf commit ac90e9c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ function run_test($php, $file, $env)
}

// 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');

Expand Down Expand Up @@ -1483,6 +1483,18 @@ function run_test($php, $file, $env)
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.
Expand Down

0 comments on commit ac90e9c

Please sign in to comment.