# from Rafael Garcia-Suarez
# on Wednesday 09 January 2008 05:36:

>Allison Randal wrote in perl.perl6.internals :
>> In the Python test suite, there's a single global location to
>> declare a list of test files that are expected to be skipped on a
>> particular platform. This has a much cleaner feel than our own
>> motley collection of skip and todo markers in various test files.

To me, python code generally tends to *feel* cleaner, but on deeper 
inspection, usually is limited by failed assumptions.  I suspect that 
you've fallen prey to this same seduction in your perusal of their test 
suite.  There may still be something in it -- I'm just adding salt :-D

A global skip/todo config would be nice in that it also provides more 
metadata about the tests, so e.g. running a targetted cross-section of 
tests becomes easier.

>That assumes that tests are skipped per file, which is not always the
>case (sometimes you want to skip only one test, sometimes even to work
>around an OS bug that appears only in one specific version). But
>reorganizing platform-dependent tests might be a good idea.

Agreed.  Skipping a subtest is very common.  Organization would benefit 
from them being separated, but duplicated setup code would ensue.

If tests were broken into methods within the file, you could have the 
global config and keep the granularity.

The "what is a platform?" issue could also make the categorization messy 
(when you start involving compiler combinations or what-not.)  Perhaps 
something more declarative can be done by providing standard is_foo() 
functions to reduce the complexity (and/or increase the readability) of 
the SKIP/TODO conditionals.

So, (syntax aside) given foo.t with methods bar, baz, bort, and bob:

  t/foo.t
    is_osx(version: 10.0): skip_all: reason: ...
    is_osx: skip: bar baz bort
    is_solaris: todo: baz reason: baz needs love
    is_win32(with => compiler: msvc): todo: bort

--Eric
-- 
software:  a hypothetical exercise which happens to compile.
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to