com php-src: Use PHP_BINARY by default in run-tests .php: run-tests.php
| From: | Nikita Popov | Date: | Wed, 20 Feb 2019 11:38:40 +0000 |
| Subject: | com php-src: Use PHP_BINARY by default in run-tests .php: run-tests.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-104780@lists.php.net to get a copy of this message | ||
Commit: 57fef27521814c575a7ea32abf4bda44f78ff400
Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 20 Feb 2019 12:38:40 +0100
Parents: 10e189de76518946c2d5deb28fc10bc8e7d7d365
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=57fef27521814c575a7ea32abf4bda44f78ff400
Log:
Use PHP_BINARY by default in run-tests.php
You pretty much always want to run with -P, make it the default.
Changed paths:
M run-tests.php
Diff:
diff --git a/run-tests.php b/run-tests.php
index 3221766..0f2d9ea 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -160,10 +160,6 @@ NO_PROC_OPEN_ERROR;
$environment["SystemRoot"] = getenv("SystemRoot");
}
- // Don't ever guess at the PHP executable location.
- // Require the explicit specification.
- // Otherwise we could end up testing the wrong file!
-
$php = null;
$php_cgi = null;
$phpdbg = null;
@@ -461,11 +457,7 @@ NO_PROC_OPEN_ERROR;
$environment['TEST_PHP_EXECUTABLE'] = $php;
break;
case 'P':
- if (constant('PHP_BINARY')) {
- $php = PHP_BINARY;
- } else {
- break;
- }
+ $php = PHP_BINARY;
putenv("TEST_PHP_EXECUTABLE=$php");
$environment['TEST_PHP_EXECUTABLE'] = $php;
break;
@@ -567,7 +559,7 @@ Options:
-p <php> Specify PHP executable to run.
- -P Use PHP_BINARY as PHP executable to run.
+ -P Use PHP_BINARY as PHP executable to run (default).
-q Quiet, no user interaction (same as environment NO_INTERACTION).
@@ -652,6 +644,13 @@ HELP;
}
}
+ // Default to PHP_BINARY as executable
+ if (!isset($environment['TEST_PHP_EXECUTABLE'])) {
+ $php = PHP_BINARY;
+ putenv("TEST_PHP_EXECUTABLE=$php");
+ $environment['TEST_PHP_EXECUTABLE'] = $php;
+ }
+
if (strlen($conf_passed)) {
if (substr(PHP_OS, 0, 3) == "WIN") {
$pass_options .= " -c " . escapeshellarg($conf_passed);