com php-src: Don't generate script for proc_open_pipes te sts: ext/standard/tests/general_functions/proc_open_p ipes.inc
ext/standard/tests/general_functions/proc_open _pipes1.phpt ext/standard/tests/general_functions/pro c_open_pipes2.phpt
ext/standard/tests/general_funct ions/proc_open_pipes3.phpt ext/standard/tests/general _functions/proc_open_pipes_sleep.inc
| From: | Nikita Popov | Date: | Mon, 04 Mar 2019 09:52:50 +0000 |
| Subject: | com php-src: Don't generate script for proc_open_pipes te sts: ext/standard/tests/general_functions/proc_open_p ipes.inc ext/standard/tests/general_functions/proc_open _pipes1.phpt ext/standard/tests/general_functions/pro c_open_pipes2.phpt ext/standard/tests/general_funct ions/proc_open_pipes3.phpt ext/standard/tests/general _functions/proc_open_pipes_sleep.inc |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-104974@lists.php.net to get a copy of this message | ||
Commit: 6be93b29ebc54ffcfd3ed689885c7040609a38aa
Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 4 Mar 2019 10:52:50 +0100
Parents: e27ba75e0f2929cc2ecbbb45761eec60fd9abffb
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6be93b29ebc54ffcfd3ed689885c7040609a38aa
Log:
Don't generate script for proc_open_pipes tests
Commit the generated script instead, which is much simpler than
the code generating it...
Changed paths:
D ext/standard/tests/general_functions/proc_open_pipes.inc
M ext/standard/tests/general_functions/proc_open_pipes1.phpt
M ext/standard/tests/general_functions/proc_open_pipes2.phpt
M ext/standard/tests/general_functions/proc_open_pipes3.phpt
A ext/standard/tests/general_functions/proc_open_pipes_sleep.inc
Diff:
diff --git a/ext/standard/tests/general_functions/proc_open_pipes.inc
b/ext/standard/tests/general_functions/proc_open_pipes.inc
deleted file mode 100644
index 576118f..0000000
--- a/ext/standard/tests/general_functions/proc_open_pipes.inc
+++ /dev/null
@@ -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);
- }
-}
diff --git a/ext/standard/tests/general_functions/proc_open_pipes1.phpt
b/ext/standard/tests/general_functions/proc_open_pipes1.phpt
index f3335bc..dd0550f 100644
--- a/ext/standard/tests/general_functions/proc_open_pipes1.phpt
+++ b/ext/standard/tests/general_functions/proc_open_pipes1.phpt
@@ -3,27 +3,18 @@ proc_open() with > 16 pipes
--FILE--
<?php
-include dirname(__FILE__) .. "/proc_open_pipes.inc";
-
for ($i = 3; $i<= 30; $i++) {
$spec[$i] = array('pipe', 'w');
}
$php = getenv("TEST_PHP_EXECUTABLE");
-$callee = create_sleep_script();
+$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
proc_open("$php -n $callee", $spec, $pipes);
var_dump(count($spec));
var_dump($pipes);
?>
---CLEAN--
-<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
-unlink_sleep_script();
-
-?>
--EXPECTF--
int(28)
array(28) {
diff --git a/ext/standard/tests/general_functions/proc_open_pipes2.phpt
b/ext/standard/tests/general_functions/proc_open_pipes2.phpt
index 2173477..3c1cf96 100644
--- a/ext/standard/tests/general_functions/proc_open_pipes2.phpt
+++ b/ext/standard/tests/general_functions/proc_open_pipes2.phpt
@@ -3,25 +3,16 @@ proc_open() with no pipes
--FILE--
<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
$spec = array();
$php = getenv("TEST_PHP_EXECUTABLE");
-$callee = create_sleep_script();
+$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
proc_open("$php -n $callee", $spec, $pipes);
var_dump(count($spec));
var_dump($pipes);
?>
---CLEAN--
-<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
-unlink_sleep_script();
-
-?>
--EXPECT--
int(0)
array(0) {
diff --git a/ext/standard/tests/general_functions/proc_open_pipes3.phpt
b/ext/standard/tests/general_functions/proc_open_pipes3.phpt
index d649870..7671b1d 100644
--- a/ext/standard/tests/general_functions/proc_open_pipes3.phpt
+++ b/ext/standard/tests/general_functions/proc_open_pipes3.phpt
@@ -3,14 +3,12 @@ proc_open() with invalid pipes
--FILE--
<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
for ($i = 3; $i<= 5; $i++) {
$spec[$i] = array('pipe', 'w');
}
$php = getenv("TEST_PHP_EXECUTABLE");
-$callee = create_sleep_script();
+$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
$spec[$i] = array('pi');
proc_open("$php -n $callee", $spec, $pipes);
@@ -28,13 +26,6 @@ var_dump($pipes);
echo "END\n";
?>
---CLEAN--
-<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
-unlink_sleep_script();
-
-?>
--EXPECTF--
Warning: proc_open(): pi is not a valid descriptor spec/mode in %s on line %d
diff --git a/ext/standard/tests/general_functions/proc_open_pipes_sleep.inc
b/ext/standard/tests/general_functions/proc_open_pipes_sleep.inc
new file mode 100644
index 0000000..53eab09
--- /dev/null
+++ b/ext/standard/tests/general_functions/proc_open_pipes_sleep.inc
@@ -0,0 +1,2 @@
+<?php
+sleep(1);