Re: PHPT --SKIPIF--
| From: | Gregory Beaver | Date: | Thu, 05 Apr 2007 22:51:50 +0000 |
| Subject: | Re: PHPT --SKIPIF-- | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-46155@lists.php.net to get a copy of this message | ||
Joe Stump wrote:
> Basically if you have something like this:
>
> 001-test-a.phpt
> 002-test-b.phpt
>
> I'd like to know in 002-test-b.phpt if 001-test-a.phpt failed. I was
> able to do this by adding this into my 002-test-b.phpt file:
>
> --SKIPIF--
> <?php
>
> if (file_exists('002-test-a.out')) {
> echo 'skip 002-test-a.phpt failed';
> }
>
> ?>
>
> It appears to work fine.
If you run the tests out of order, it will fail, so you need to be sure
that the OS will sort them properly. For instance, try
pear run-tests 001-test-a.phpt 002-test-b.phpt
and see if it still works.
What I meant though is *why* do you need to skip a test if the previous
test failed? Why not just let them both fail?
Greg