PATCH: run-tests.php -l flag (local / non-recurisve)

php.internals

Daniel Convissor

22 years ago
Hi: As you probably know, run-tests.php runs recursively through each subdirectory encountered. I've run into circumstances where it is helpful to have it just run files in the present directory, without recursion. I have created a patch which watches for an "-l" flag. The -l flag is similar to the one used with CVS. Considering this is a simple, optional and helpful change, I hope this can be applied to the all branches, please. http://www.analysisandsolutions.com/php/run-tests.local.option.diff Thanks, --Dan
-- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

Jan Lehnardt

22 years ago
Hi, On 19 Feb 2004, at 22:50, Daniel Convissor wrote:
> As you probably know, run-tests.php runs recursively through each > subdirectory encountered. I've run into circumstances where it is > helpful > to have it just run files in the present directory, without recursion. > I > have created a patch which watches for an "-l" flag. The -l flag is > similar to the one used with CVS.
TESTS=/path/test/dir make test or even TESTS=/path/to/test.phpt make test works just fine, already. There are plans to change run-tests.php so it accepts arguments instead of environment variables, but nothing happened in this direction, yet. regards, Jan
--

Hartmut Holzgraefe

22 years ago
Jan Lehnardt wrote:
> TESTS=/path/test/dir make test or even TESTS=/path/to/test.phpt make test > works just fine, already.
TESTS=/path/test/dir would still dive into /past/test/dir/subdir, wouldn't it?
> There are plans to change run-tests.php so it accepts arguments instead > of environment variables, but nothing happened in this direction, yet.
that's not really true, it's more like "nothing has been commited yet" ;)
-- Hartmut Holzgraefe <hartmut@php.net>

Marcus Börger

22 years ago
Hello Hartmut, Friday, February 20, 2004, 12:49:32 PM, you wrote:
> Jan Lehnardt wrote: >> TESTS=/path/test/dir make test or even TESTS=/path/to/test.phpt make test >> works just fine, already.
> TESTS=/path/test/dir would still dive into /past/test/dir/subdir, > wouldn't it?
>> There are plans to change run-tests.php so it accepts arguments instead >> of environment variables, but nothing happened in this direction, yet.
> that's not really true, it's more like "nothing has been commited yet" ;)
well i did some of those commits...long ago...or did i miss anything?????? i'd simply use php run-tests.php <whateverfile-or-dir-you-want> .... if you want local files only without recursion then you can use find but that doesn't help on windows. Anyway i see no reason because at least until now there is not a single one extension where this functionality would be of any use because test directories do not have sub-test-dirs. And btw. for example: php run-tests.php ext/dba is shorter than php run-tests.php ext/dba/tests but does the same because of the recursion
-- Best regards, Marcus mailto:helly@php.net

Hartmut Holzgraefe

22 years ago
Marcus Boerger wrote:
> well i did some of those commits...long ago...or did i miss anything??????
i was refering to stuff hidden somewhere on my disk ..
> > i'd simply use php run-tests.php <whateverfile-or-dir-you-want> .... > if you want local files only without recursion then you can use find but > that doesn't help on windows. Anyway i see no reason because at least until > now there is not a single one extension where this functionality would be of > any use because test directories do not have sub-test-dirs.
ext/standard/tests has ;) that aside i did not state whether the non-recursive option proposed by Daniel makes sense, i was just trying to point out that Jans replay slightly missed the point of the original request ...
-- Hartmut Holzgraefe <hartmut@php.net>

Daniel Convissor

22 years ago
Hi Marcus: On Fri, Feb 20, 2004 at 06:40:22PM +0100, Marcus Boerger wrote:
> > Anyway i see no reason because at least until > now there is not a single one extension where this functionality would be of > any use because test directories do not have sub-test-dirs.
The test platform is used in many places beside PHP development itself. This issue arose for me in the testing of PEAR DB, which does have a subdirectory.
> And btw. for > example: > php run-tests.php ext/dba > is shorter than > php run-tests.php ext/dba/tests > but does the same because of the recursion
And the patch wouldn't change that. It just allows people to choose whether they want recursion or not. Thanks, --Dan
-- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

Marcus Börger

22 years ago
Hello Daniel, Friday, February 20, 2004, 6:54:19 PM, you wrote:
> Hi Marcus:
> On Fri, Feb 20, 2004 at 06:40:22PM +0100, Marcus Boerger wrote: >> >> Anyway i see no reason because at least until >> now there is not a single one extension where this functionality would be of >> any use because test directories do not have sub-test-dirs.
> The test platform is used in many places beside PHP development itself. > This issue arose for me in the testing of PEAR DB, which does have a > subdirectory.
Ah - ok then :-)
>> And btw. for >> example: >> php run-tests.php ext/dba >> is shorter than >> php run-tests.php ext/dba/tests >> but does the same because of the recursion
> And the patch wouldn't change that. It just allows people to choose > whether they want recursion or not.
-- Best regards, Marcus mailto:helly@php.net

Marcus Börger

22 years ago
Hello Daniel, since there seems to be a usage i looked into including it. Unfortunatley your patch doesn't help me. I'd need you to look into php5's version of the script. There you'll see that the switch 'l' is already being used. Hence i'd say we go with 'L' unless you find a better name. Friday, February 20, 2004, 6:54:19 PM, you wrote:
> Hi Marcus:
> On Fri, Feb 20, 2004 at 06:40:22PM +0100, Marcus Boerger wrote: >> >> Anyway i see no reason because at least until >> now there is not a single one extension where this functionality would be of >> any use because test directories do not have sub-test-dirs.
> The test platform is used in many places beside PHP development itself. > This issue arose for me in the testing of PEAR DB, which does have a > subdirectory.
>> And btw. for >> example: >> php run-tests.php ext/dba >> is shorter than >> php run-tests.php ext/dba/tests >> but does the same because of the recursion
> And the patch wouldn't change that. It just allows people to choose > whether they want recursion or not.
> Thanks,
> --Dan
> -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
-- Best regards, Marcus mailto:helly@php.net

Derick Rethans

22 years ago
On Fri, 20 Feb 2004, Jan Lehnardt wrote:
> Hi, > On 19 Feb 2004, at 22:50, Daniel Convissor wrote: > > As you probably know, run-tests.php runs recursively through each > > subdirectory encountered. I've run into circumstances where it is > > helpful > > to have it just run files in the present directory, without recursion. > > I > > have created a patch which watches for an "-l" flag. The -l flag is > > similar to the one used with CVS. > > TESTS=/path/test/dir make test or even TESTS=/path/to/test.phpt make > test works just fine, already.
And also: TESTS=path/test/dir/*.phpt make test so you don't need anything new for this to work. Derick

Daniel Convissor

22 years ago
On Fri, Feb 20, 2004 at 07:13:51PM +0100, Derick Rethans wrote:
> TESTS=path/test/dir/*.phpt make test > so you don't need anything new for this to work.
True enough. Thanks, --Dan
-- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409