Re: Tests repository
| From: | Geoffrey Sneddon | Date: | Tue, 16 Mar 2010 23:05:37 +0000 |
| Subject: | Re: Tests repository | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-47369@lists.php.net to get a copy of this message | ||
On 12 Mar 2010, at 12:37, Jani Taskinen wrote:
On 03/12/2010 12:29 PM, Hannes Magnusson wrote:I'd rather just check for whether a feature exists or not, rather than hard-coding version numbers in tests. For example, hat happens if the PHP 5.3/6 case repeats itself, with more and more being backported? Do we need to go through and change skip-version metadata on hundreds of tests? Could we not just check that, e.g., "get_called_class" exists? With such feature testing (in skipif?) we could just do something along the lines of: ---FILE--- <?php if (version_compare(PHP_VERSION, '5.3', '>=') && function_exists('get_called_class')) echo 'PASS'; elseif (version_compare(PHP_VERSION, '5.3', '<') && !function_exists('get_called_class')) echo 'PASS'; else echo 'FAIL'; ?> --EXPECTF-- PASS Then, through the magic of logic, we would be guaranteed to have the right results for each version if all tests pass, and only one place to change when backporting/removing a feature. -gOn Fri, Mar 12, 2010 at 11:18, Jani Taskinen<jani.taskinen@iki.fi> wrote:Perhaps something like required min version is better. Any ideas who has been working on the improved test stuff? Or was that just a dream?Having tests in multiple branches is PITA. Hasn't anyone considered that the best way would be to move all tests into their own repository (directory..whatever :) in SVN..? Considering they are supposed to be used for testing against regressions and BC breaks, they should always be runnable using any PHP version?Thats actually a fairly good idea. Some tests however are not supposed to work in earlier releases, so we need to either add a new ==SKIP-VERSION== 5.2, 5.1, 5.0