Re: SKIPIF print vs die
| From: | Eric Stewart | Date: | Tue, 28 Apr 2009 18:24:40 +0000 |
| Subject: | Re: SKIPIF print vs die | ||
| References: | 1 2 3 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-64815@lists.php.net to get a copy of this message | ||
If you are not stopping a test that would normally be skipped so that you
can debug it locally, is that something that should be committed to CVS? I
would think that all tests which are committed should actually be skipped if
they are supposed to be. So if we are gonna change the comments regarding
this, should we be clear that tests should properly skip before being
committed?
Eric Lee Stewart
ericleestewart@gmail.com
On Tue, Apr 28, 2009 at 1:30 PM, Greg Beaver <greg@chiaraquartet.net> wrote:
> zoe wrote:
> > Daniel Convissor wrote:
> >> Hi Folks:
> >>
> >> I'm reading up on .phpt's because I'll be giving a tutorial at New
> >> York's test fest event.
> >>
> >> The SKIPIF section info at 0ÌX=î¯,%p2.
> >> http://qa.php.net/write-test.php uses print
> >> 'skip whatever' rather than die('skip whatever'), which is
> >> commonly
> >> used in actual tests. die() seems preferable since it will halt
> >> undesirable execution when calling the .phpt file directly (as
> >> discussed at the bottom of the write-test web page.
> >>
> > Yes, I see your point. From that point of view using die() is preferable.
> >> I'm wondering what people think about this and whether write-test
> >> needs tweaking.
> >>
> > I'll tweak it no one comes up with a counter argument.
>
> I've had a few cases where die() was less desirable because I wanted to
> be able to run the test even when it would fail, so I could step through
> to fix things. In other cases, the SKIPIF was complex enough that it
> would sometimes skip when it shouldn't.
>
> Thus, I'd say use per-test criteria to determine which way is better.
>
> Perhaps use
>
> // use echo 'skip whatever'; if you want to be able to step through the
> // test with a debugger no matter what
> die('skip whatever');
>
> to suggest the most commonly successful skipping method, but mention the
> other.
>
> Greg
>
> --
> PHP Quality Assurance Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>