Perl's not the only TAP source

Steve Purkis steve at purkis.ca
Mon Apr 13 22:22:09 GMT 2009


Righty-o,

There's a workable draft in trunk.  Before you panic, don't: it's not  
yet used by TAP::Parser, I just wanted to commit something as a  
discussion point.

The best starting point is t/source_factory.t  and  
TAP::Parser::SourceFactory.  If you want to see it working, swap the  
comment on lines 484 & 485 of TAP::Parser, and run t/parse.t

Design notes:
* went for registry rather than auto-discovered plugins
** means less easy to extend, but perhaps more guaranteed operability
*** eg: a dodgy plugin would have to be loaded with a -P first, in  
order to affect everything
** really useful & reliable plugins can still be auto-detected  
'manually' with some more hacking
* went for levels of confidence for source detectors
** that way can be overridden
* not sure if we need both Sources & SourceDetectors
** could be useful in some cases though
** eg: using a different Perl, as discussed earlier in this thread

If this is the right way, to finish this I reckon we'd need to:

1. make TAP::Parser::Source more generic
* not everything's a cmd anymore
* so subclassing 'pgTAP' would make sense

2. integrate the SourceFactory into TAP::Parser
* replace all the source stuff in _initialize() with it
* maybe replace the 'exec' stuff too?
** if not, introduce an 'exec_source_class'

3. update docs
* subclassing guide

All of this requires a deprecation cycle... which means a release.  I  
suppose all the work could be done in a sub-class of TAP::Parser.

What do people think - is this the right way forward?

+--
   Steve Purkis



On 10 Apr 2009, at 20:48, Andy Armstrong wrote:

> On 10 Apr 2009, at 20:11, Steve Purkis wrote:
>> Good to know you're interested.  If work doesn't take over my life
>> again, I should be able to get something together next week.
>
>
> Thanks for this Steve - sounds like a spendid idea.
>
> -- 
> Andy Armstrong, Hexten
>
> _______________________________________________
> tapx-dev mailing list
> tapx-dev at hexten.net
> http://www.hexten.net/mailman/listinfo/tapx-dev
> cpan: http://search.cpan.org/dist/TAP-Parser/
> bugs: http://rt.cpan.org/Public/Dist/Display.html?Name=TAP-Parser

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.hexten.net/pipermail/tapx-dev/attachments/20090413/d9712162/attachment-0001.htm 


More information about the tapx-dev mailing list