Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55342 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76512 invoked from network); 9 Sep 2011 18:03:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2011 18:03:41 -0000 Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 141.146.126.227 cause and error) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 141.146.126.227 acsinet15.oracle.com Received: from [141.146.126.227] ([141.146.126.227:47642] helo=acsinet15.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 73/78-33036-BF45A6E4 for ; Fri, 09 Sep 2011 14:03:40 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p89I3ZDB021567 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 9 Sep 2011 18:03:36 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p89I3Y9w027752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 9 Sep 2011 18:03:35 GMT Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p89I3TtN003123 for ; Fri, 9 Sep 2011 13:03:29 -0500 Received: from [10.159.230.145] (/10.159.230.145) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 09 Sep 2011 11:03:29 -0700 Message-ID: <4E6A54EF.9010000@oracle.com> Date: Fri, 09 Sep 2011 11:03:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.4E6A54F9.0013:SCFMA922111,ss=1,re=-4.000,fgs=0 Subject: Re: [PHP-DEV] [PATCH] Autoguessing TEST_PHP_EXECUTABLE if none is provided in run-tests.php From: christopher.jones@oracle.com (Christopher Jones) On 09/08/2011 05:07 AM, Alexey Shein wrote: > Hello! > I've made some improvements to run-tests.php: > 1) Autoguessing TEST_PHP_EXECUTABLE and TEST_PHP_CGI_EXECUTABLE if > they're not provided, i.e. assume they have value 'auto'. You can > still pass your own value as usual. > 2) Added option -n (use no php.ini) to the shebang line > (#!/usr/bin/php -n) so it would run more reliably on some hosts. My > Ubuntu setup did not have E letter in variables_order (i.e. > variables_order=GPCS) so $_ENV array was empty and some tests were > skipped when they could be run. > 3) Some better error handling of wrong paths > > So now you can run run-tests.php with just > $ ./run-tests.php ext > instead of > $ TEST_PHP_EXECUTABLE=auto php -n run-tests.php ext > > You can also run run-tests.php from sub-dir, it will correctly guess > 'auto' as well: > $ cd ext/ > $ ../run-tests.php zlib > > Please, review this patch and, if there's no objections, I will > prepare 5.4 and 5.3 versions too. > > > > I don't have a problem with the intent to make it easier and more failsafe. In particular I'm +1 on autoguessing, which might be a marginally contentious change for some developers. A few of us build PHP outside the svn source tree. The following modification to your patch fixes the intended autodetection in this scenario: if ($php == 'auto') { $php = realpath($CUR_DIR . '/sapi/cli/php'); if (!$php) { $php = realpath(__DIR__ . '/sapi/cli/php'); } putenv("TEST_PHP_EXECUTABLE=$php"); } $environment['TEST_PHP_EXECUTABLE'] = $php; It allows the following to work for me: cd ~/phpbuild ./sapi/cli/php -n ~/phpsrc/php/php-src/branches/PHP_5_4/run-tests.php /tmp/array_bind_001.phpt Since run-tests.php is kept in sync on all branches, you'll only need one version of the patch. Chris -- Email: christopher.jones@oracle.com Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/