Re: Re: PHPT --SKIPIF--
| From: | Helgi Þormar Þorbjörnsson | Date: | Thu, 05 Apr 2007 23:26:34 +0000 |
| Subject: | Re: Re: PHPT --SKIPIF-- | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-46157@lists.php.net to get a copy of this message | ||
On Thu, 05 Apr 2007 15:57:59 -0700, Joe Stump wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>> 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.
>
> This works. Running them backwards would cause the check to not work as
> expected, but it wouldn't fail catastrophically either.
>
>> 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?
>
> Because, if 001-test-a fails and 002-test-b relies on 001-test-a for
> something (ie. data written to the DB, memcache, etc.) 002-tests-b isn't
> actually failed. It's like saying that your test of gd failed when gd
> isn't installed at all. The test didn't actually fail because it never
> had a chance of running. It should skip the test and say why and move
> on.
Isn't the point of testing to keep each part as a self contained beast ?
Anyway I've always believed that tests should be able to run by them self
and thus not having the exact problem you are describing ;-)
You could take the approach to have a setup/teardown function in the
tests to setup the data you need for each individual test.
Regards
Helgi
--
There are no stupid questions, only stupid people