]> granicus.if.org Git - php/commitdiff
- Allow to specify php executable on commandline
authorMarcus Boerger <helly@php.net>
Wed, 5 Dec 2007 13:55:46 +0000 (13:55 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 5 Dec 2007 13:55:46 +0000 (13:55 +0000)
run-tests.php

index b54efad81960fcd5b4e1254c504aa029a14038d1..7a67f1a6998579aea56fe128a93ac593ef6fc217 100755 (executable)
@@ -122,8 +122,10 @@ if (getenv('TEST_PHP_CGI_EXECUTABLE')) {
        $environment['TEST_PHP_CGI_EXECUTABLE'] = $php_cgi;
 }
 
-if ($argc !=2 || ($argv[1] != '-h' && $argv[1] != '-help' && $argv != '--help'))
+function verify_config()
 {
+       global $php;
+
        if (empty($php) || !file_exists($php)) {
                error("environment variable TEST_PHP_EXECUTABLE must be set to specify PHP executable!");
        }
@@ -350,6 +352,10 @@ if (isset($argc) && $argc > 1) {
                                case '--no-clean':
                                        $no_clean = true;
                                        break;
+                               case 'p':
+                                       $php = $argv[++$i];
+                                       putenv("TEST_PHP_EXECUTABLE=$php");
+                                       break;
                                case 'q':
                                        putenv('NO_INTERACTION=1');
                                        break;
@@ -541,6 +547,7 @@ HELP;
        }
 }
 
+verify_config();
 write_information($html_output);
 
 // Compile a list of all test files (*.phpt).