mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Don't generate script for proc_open_pipes tests
Commit the generated script instead, which is much simpler than the code generating it...
This commit is contained in:
parent
e27ba75e0f
commit
6be93b29eb
5 changed files with 5 additions and 51 deletions
|
@ -1,21 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
function create_sleep_script()
|
|
||||||
{
|
|
||||||
$fname = dirname(__FILE__) . DIRECTORY_SEPARATOR . "proc_open_pipes_sleep.php";
|
|
||||||
|
|
||||||
if (!file_exists($fname)) {
|
|
||||||
file_put_contents($fname, "<?php\nsleep(1);\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return $fname;
|
|
||||||
}
|
|
||||||
|
|
||||||
function unlink_sleep_script()
|
|
||||||
{
|
|
||||||
$fname = dirname(__FILE__) . DIRECTORY_SEPARATOR . "proc_open_pipes_sleep.php";
|
|
||||||
|
|
||||||
if (file_exists($fname)) {
|
|
||||||
unlink($fname);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,26 +3,17 @@ proc_open() with > 16 pipes
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include dirname(__FILE__) . "/proc_open_pipes.inc";
|
|
||||||
|
|
||||||
for ($i = 3; $i<= 30; $i++) {
|
for ($i = 3; $i<= 30; $i++) {
|
||||||
$spec[$i] = array('pipe', 'w');
|
$spec[$i] = array('pipe', 'w');
|
||||||
}
|
}
|
||||||
|
|
||||||
$php = getenv("TEST_PHP_EXECUTABLE");
|
$php = getenv("TEST_PHP_EXECUTABLE");
|
||||||
$callee = create_sleep_script();
|
$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
|
||||||
proc_open("$php -n $callee", $spec, $pipes);
|
proc_open("$php -n $callee", $spec, $pipes);
|
||||||
|
|
||||||
var_dump(count($spec));
|
var_dump(count($spec));
|
||||||
var_dump($pipes);
|
var_dump($pipes);
|
||||||
|
|
||||||
?>
|
|
||||||
--CLEAN--
|
|
||||||
<?php
|
|
||||||
include dirname(__FILE__) . "/proc_open_pipes.inc";
|
|
||||||
|
|
||||||
unlink_sleep_script();
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
int(28)
|
int(28)
|
||||||
|
|
|
@ -3,24 +3,15 @@ proc_open() with no pipes
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include dirname(__FILE__) . "/proc_open_pipes.inc";
|
|
||||||
|
|
||||||
$spec = array();
|
$spec = array();
|
||||||
|
|
||||||
$php = getenv("TEST_PHP_EXECUTABLE");
|
$php = getenv("TEST_PHP_EXECUTABLE");
|
||||||
$callee = create_sleep_script();
|
$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
|
||||||
proc_open("$php -n $callee", $spec, $pipes);
|
proc_open("$php -n $callee", $spec, $pipes);
|
||||||
|
|
||||||
var_dump(count($spec));
|
var_dump(count($spec));
|
||||||
var_dump($pipes);
|
var_dump($pipes);
|
||||||
|
|
||||||
?>
|
|
||||||
--CLEAN--
|
|
||||||
<?php
|
|
||||||
include dirname(__FILE__) . "/proc_open_pipes.inc";
|
|
||||||
|
|
||||||
unlink_sleep_script();
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
int(0)
|
int(0)
|
||||||
|
|
|
@ -3,14 +3,12 @@ proc_open() with invalid pipes
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include dirname(__FILE__) . "/proc_open_pipes.inc";
|
|
||||||
|
|
||||||
for ($i = 3; $i<= 5; $i++) {
|
for ($i = 3; $i<= 5; $i++) {
|
||||||
$spec[$i] = array('pipe', 'w');
|
$spec[$i] = array('pipe', 'w');
|
||||||
}
|
}
|
||||||
|
|
||||||
$php = getenv("TEST_PHP_EXECUTABLE");
|
$php = getenv("TEST_PHP_EXECUTABLE");
|
||||||
$callee = create_sleep_script();
|
$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
|
||||||
|
|
||||||
$spec[$i] = array('pi');
|
$spec[$i] = array('pi');
|
||||||
proc_open("$php -n $callee", $spec, $pipes);
|
proc_open("$php -n $callee", $spec, $pipes);
|
||||||
|
@ -27,13 +25,6 @@ proc_open("$php -n $callee", $spec, $pipes);
|
||||||
var_dump($pipes);
|
var_dump($pipes);
|
||||||
|
|
||||||
echo "END\n";
|
echo "END\n";
|
||||||
?>
|
|
||||||
--CLEAN--
|
|
||||||
<?php
|
|
||||||
include dirname(__FILE__) . "/proc_open_pipes.inc";
|
|
||||||
|
|
||||||
unlink_sleep_script();
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: proc_open(): pi is not a valid descriptor spec/mode in %s on line %d
|
Warning: proc_open(): pi is not a valid descriptor spec/mode in %s on line %d
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
<?php
|
||||||
|
sleep(1);
|
Loading…
Add table
Add a link
Reference in a new issue