Re: Request to be added to PHP_LexerGenerator (and probably PHP_ParserGenerator)
| From: | Gregory Beaver | Date: | Tue, 25 Sep 2007 03:02:15 +0000 |
| Subject: | Re: Request to be added to PHP_LexerGenerator (and probably PHP_ParserGenerator) | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-48176@lists.php.net to get a copy of this message | ||
Alan Langford wrote:
> I've spent some time looking at both PHPUnit and .phpt and I have
> similar problems with both, which means the problem is probably with
> me instead...
>
> I'm trying to set things up so that I can make a change and run one or
> more tests in the shortest cycle possible, but both test facilities
> assume an installed code tree, so that PHP_LexerGenerator_Lexer is
> expected to be found as the installed /PHP/LexerGenerator/Lexer.php
> rather than CVS's PHP_LexerGenerator/LexerGenerator/Lexer.php
>
> Please tell me that there's a simple approach for this. Right now it
> looks like the right thing to do is to set up a parallel install of
> PEAR, write a build script that will push my changes and any
> dependencies into the parallel install, then run everything under a
> wrapper that points at the test environment.
>
> I'm thinking that possibly I can write an __autoload function that
> looks for an environment variable (PHP_PEAR_CVS_DIR) and pulls the
> right files in using that. Does that seem workable?
Hi Alan,
Let's back up a second. The tests should be testing the environment
that the user will be most likely to experience. If you're running
tests out of CVS, you're in fact testing an environment that 0 (zero)
users will experience.
Just assume include_path is set up and require_once
'PHP/LexerGenerator.php';
When developing, you need to become a master at the samurai art of:
pear up -f package.xml
keep a dos box/terminal open and use <up arrow> <enter> to repeatedly
upgrade when you make changes, and then you can be assured that your
PEAR installation has the latest changes.
Greg