Skipping test using .INI file
| From: | Felipe Pena | Date: | Tue, 21 Oct 2008 15:18:03 +0000 |
| Subject: | Skipping test using .INI file | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-64470@lists.php.net to get a copy of this message | ||
Hi all!
I made a patch that add possibility to describe tests to be skipped
by .INI file (it must be named 'skip.ini'). As you can see in the
find_ini_skip(), there is a simple cache to avoid repeated searching and
parsing the same skip.ini.
Simple example of path valid:
php5/ext/pcre/test/skip.ini
Other possibilities:
php5/ext/soap/tests/interop/Round2/Base/skip.ini
Here the skip.ini could be too in:
php5/ext/soap/tests/interop/Round2/skip.ini
php5/ext/soap/tests/interop/skip.ini
php5/ext/soap/tests/skip.ini
php5/ext/soap/skip.ini
OK?! :)
To describe that a test should be skipped by architecture, we must use:
[SKIP_32]
test[]=foo.phpt
test[]=bar.phpt
[SKIP_64]
test[]=baz.phpt
An by OS name:
[SKIP_OS:WINDOWS]
test[]=bla.phpt
It's possible to use more OSes in the list, see below:
[SKIP_OS:BSD, AIX, SOLARIS]
test[]=foo.phpt
By required extensions:
[REQUIRED_EXTENSION:CALENDAR]
test[]=abc.phpt
And checking for more than one extension loaded:
[REQUIRED_EXTENSION:ZIP + MHASH]
test[]=x.phpt
test[]=y.phpt
And to skip using a php code (as it done usually by DB extensions):
[Bla bla bla]
skip[]=check_connection.inc
skip[]=testing_another_thing.inc
test[]=a.phpt
test[]=b.phpt
If check_connection.inc or testing_another_thing.inc does:
die('skip foobar');
the 'foobar' is kept as the reason on skipped test message.
But if it does only: die('skip'); the 'Bla bla bla' as was used on .INI,
will be the text to reason on skipped test message.
Patch: http://felipe.ath.cx/diff/run-tests.diff
Examples:
PCRE: http://felipe.ath.cx/skip.ini.pcre
HASH: http://felipe.ath.cx/skip.ini.hash
And about wildcard in the file name, I could add if needed. :)
Any objection? Any idea?
Well, you already knows me, sorry for English! :D
--
Regards,
Felipe Pena