Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55343 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80522 invoked from network); 9 Sep 2011 18:12:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2011 18:12:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=confik@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=confik@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: confik@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gy0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:65036] helo=mail-gy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/49-33036-6F65A6E4 for ; Fri, 09 Sep 2011 14:12:07 -0400 Received: by gyb11 with SMTP id 11so373242gyb.29 for ; Fri, 09 Sep 2011 11:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=zJJ/9mVCfeiI1M+4BKakOT6+fHWoAAD32aBUneRvojk=; b=Cq3/kGrUgjiF3weuLQofcLHXdSpk1y9Oxi8lfa+pBw2qY2jvDk/tBA+ZlGHMhs4A4y riUTUWRZt/ZTO3NHXY98cEsrv+zb3n7kNH60Ep8Pw8xNG1OVwZ5P7xLA7TZWpLe8bVKV lHwCIBwjqLzBRFV7+X/v+B4uJAEV3+JCQUcYw= Received: by 10.101.146.30 with SMTP id y30mr2149248ann.68.1315591924179; Fri, 09 Sep 2011 11:12:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.33.19 with HTTP; Fri, 9 Sep 2011 11:11:44 -0700 (PDT) In-Reply-To: <4E6A54EF.9010000@oracle.com> References: <4E6A54EF.9010000@oracle.com> Date: Fri, 9 Sep 2011 23:11:44 +0500 Message-ID: To: Christopher Jones Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [PATCH] Autoguessing TEST_PHP_EXECUTABLE if none is provided in run-tests.php From: confik@gmail.com (Alexey Shein) 2011/9/9 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=3DGPCS) 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=3Dauto 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. =C2=A0In 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. =C2=A0The following > modification to your patch fixes the intended autodetection in this > scenario: > > =C2=A0 =C2=A0if ($php =3D=3D 'auto') { > =C2=A0 =C2=A0 =C2=A0 =C2=A0$php =3D realpath($CUR_DIR . '/sapi/cli/php'); > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!$php) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$php =3D realpath(__DIR__ . '/sa= pi/cli/php'); > =C2=A0 =C2=A0 =C2=A0 =C2=A0} > =C2=A0 =C2=A0 =C2=A0 =C2=A0putenv("TEST_PHP_EXECUTABLE=3D$php"); > =C2=A0 =C2=A0} > =C2=A0 =C2=A0$environment['TEST_PHP_EXECUTABLE'] =3D $php; > > > It allows the following to work for me: > > =C2=A0 =C2=A0cd ~/phpbuild > =C2=A0 =C2=A0./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. So you mean to check sapi/cli/php in the current dir first and, if not found, further in the directory related to run-tests.php (PHP_5_4 in your example). Ok, that makes sense, usual running from svn tree will not be changed. > Chris > > -- > Email: christopher.jones@oracle.com > Tel: =C2=A0+1 650 506 8630 > Blog: =C2=A0http://blogs.oracle.com/opal/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Regards, Shein Alexey