run-tests.php improvement for PHP 7.0+

php.internals

Derick Rethans

10 years ago
Hi! I've recently been having some looks at issues between xdebug and opcache, and this meant that I need to write a test case for it. Ages ago I added support for the "--EXTENSIONS--" section in .phpt files, to load extensions that the test 'depends' on. Each item would be added to the php invocation as a "-dextension=name.so". For opcache however, that needs to be "-dzend_extension=opcache.so". The attached patch checks for opcache in the list of extensions and then uses zend_extension=. I'd like to have this in PHP 7.0 and trunk - any objections? cheers, Derick

Anatoliy Belsky

10 years ago
Hi Derick,
> -----Original Message----- > From: Derick Rethans [mailto:derick@php.net] > Sent: Monday, May 9, 2016 8:36 PM > To: PHP Developers Mailing List <internals@lists.php.net> > Cc: Anatol Belski <ab@php.net> > Subject: [PHP-DEV] run-tests.php improvement for PHP 7.0+ > > Hi! > > I've recently been having some looks at issues between xdebug and opcache, > and this meant that I need to write a test case for it. > > Ages ago I added support for the "--EXTENSIONS--" section in .phpt files,
to load
> extensions that the test 'depends' on. Each item would be added to the php > invocation as a "-dextension=name.so". For opcache however, that needs to
be
> "-dzend_extension=opcache.so". > > The attached patch checks for opcache in the list of extensions and then
uses
> zend_extension=. I'd like to have this in PHP 7.0 and trunk - any
objections?
>
IMHO fine for 7.0. Not that much zend_extension's do exist, so hardcoding some is simpler than adding yet another section. Regards Anatol

François Laupretre

10 years ago
Hi Derick, Le 09/05/2016 à 20:36, Derick Rethans a écrit :
> Hi! > > I've recently been having some looks at issues between xdebug and > opcache, and this meant that I need to write a test case for it. > > Ages ago I added support for the "--EXTENSIONS--" section in .phpt > files, to load extensions that the test 'depends' on. Each item would be > added to the php invocation as a "-dextension=name.so". For opcache > however, that needs to be "-dzend_extension=opcache.so". > > The attached patch checks for opcache in the list of extensions and then > uses zend_extension=. I'd like to have this in PHP 7.0 and trunk - any > objections? > > cheers, > Derick
I know there are not so many Zend extensions around, but I would definitely prefer a 'ZEND_EXTENSIONS' section. Regards François

Benjamin Eberlei

10 years ago
On Tue, May 10, 2016 at 2:51 AM, François Laupretre <francois@php.net> wrote:
> Hi Derick, > > > Le 09/05/2016 à 20:36, Derick Rethans a écrit : > >> Hi! >> >> I've recently been having some looks at issues between xdebug and >> opcache, and this meant that I need to write a test case for it. >> >> Ages ago I added support for the "--EXTENSIONS--" section in .phpt >> files, to load extensions that the test 'depends' on. Each item would be >> added to the php invocation as a "-dextension=name.so". For opcache >> however, that needs to be "-dzend_extension=opcache.so". >> >> The attached patch checks for opcache in the list of extensions and then >> uses zend_extension=. I'd like to have this in PHP 7.0 and trunk - any >> objections? >> >> cheers, >> Derick >> > > I know there are not so many Zend extensions around, but I would > definitely prefer a 'ZEND_EXTENSIONS' section. >
Wouldn't this work by just using --INI-- instead? --INI-- zend_extension=opcache.so greetings Benjamin

Matt F

10 years ago
An INI section wouldn't have the extension directory path AND wouldn't have the name of the SO to load. On Windows, its zend_extension=php_opcache.DLL. Typically the same opcache, etc... feature/test should work across os platforms. OpCache tests can just use a SKIPIF section to be skipped unless the user has configured OpCache to be loaded. Forcing OpCache to be loaded makes sure that test gets run during a casual test run (somebody just running `make test`). That's what a ZEND_EXTENSION section would do. There are several new section types already. If you really want to add a ZEND_EXTENSIONS section, that's fine. It is important though to have SKIPIF code that checks for such zend extensions being loaded: That allows for backwards compatibility. Also, that will avoid a mismatch with PFTT... PFTT has scenarios that can load/configure extensions for all tests to be run, fe: run all tests with opcache enabled or run all tests with opcache disabled. SKIPIF code would allow such PHPTs to be skipped or not for those scenarios, otherwise there is a mismatch in features between PFTT and run-test.php. Regards -M On Mon, May 9, 2016 at 9:07 PM, Benjamin Eberlei <kontakt@beberlei.de> wrote:

Benjamin Eberlei

10 years ago
On Tue, May 10, 2016 at 6:36 AM, Matt Ficken <themattficken@gmail.com> wrote:
> An INI section wouldn't have the extension directory path AND wouldn't > have the name of the SO to load. On Windows, its > zend_extension=php_opcache.DLL. Typically the same opcache, etc... > feature/test should work across os platforms. >
ah yes of course, sorry for the noise :)

Joe Watkins

10 years ago
Morning, I would prefer adding a zend extensions section, there might not be that many in zend extensions in the wild, but there are behind closed doors. Cheers Joe On Tue, May 10, 2016 at 7:13 AM, Benjamin Eberlei <kontakt@beberlei.de> wrote: