Discussion:
How to Port
Shlomi Fish
2013-09-06 15:16:06 UTC
Permalink
Hi all,

I'd like to know what is the best way to create a plugin for
https://metacpan.org/module/TAP::Harness which will behave similarly to
https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames . I found
out that the runtests method can accept aliases to be displayed instead of the
filename itself using an arrayref of [ $test, $alias ], so I can simply wrap
runtests() in a subclass, process the arguments, and call next::method with the
modified arguments.

However, I still don't know how to write a plugin like that exactly (and how to
get prove to recognise it). This section -
https://metacpan.org/module/TAP::Harness#WRITING-PLUGINS - explains a bit about
how to do that with some hand-waving, but does not show any complete
top-to-bottom example, and I could not find anything with a metacpan search.

My motivation for doing this is to port the rest of the functionality I miss in
Test::Run (which failed to gain mainstream acceptance, and few people
aside from me are using it) into TAP::Harness.

Regards,

Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Selina Mandrake - The Slayer (Buffy parody) - http://shlom.in/selina

bzr is slower than Subversion in combination with Sourceforge.
— Sjors, http://dazjorz.com/

Please reply to list if it's a mailing list post - http://shlom.in/reply .
Ovid
2013-09-07 21:16:08 UTC
Permalink
Here's a complete example of a TAP::Harness plugin to create a red/green progress bar.

http://blogs.perl.org/users/ovid/2010/05/making-testharness-output-a-progress-bar.html


Cheers,
Ovid
 
--
IT consulting, training, international recruiting
       http://www.allaroundtheworld.fr/.
Buy my book! - http://bit.ly/beginning_perl
Live and work overseas - http://www.overseas-exile.com/
________________________________
Sent: Friday, 6 September 2013, 17:16
Subject: How to Port https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames to TAP::Harness
Hi all,
I'd like to know what is the best way to create a plugin for
https://metacpan.org/module/TAP::Harness which will behave similarly to
https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames . I found
out that the runtests method can accept aliases to be displayed instead of the
filename itself using an arrayref of [ $test, $alias ], so I can simply wrap
runtests() in a subclass, process the arguments, and call next::method with the
modified arguments.
However, I still don't know how to write a plugin like that exactly (and how to
get prove to recognise it). This section -
https://metacpan.org/module/TAP::Harness#WRITING-PLUGINS - explains a bit about
how to do that with some hand-waving, but does not show any complete
top-to-bottom example, and I could not find anything with a metacpan search.
My motivation for doing this is to port the rest of the functionality I miss in
Test::Run (which failed to gain mainstream acceptance, and few people
aside from me are using it) into TAP::Harness.
Regards,
    Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish      http://www.shlomifish.org/
Selina Mandrake - The Slayer (Buffy parody) - http://shlom.in/selina
bzr is slower than Subversion in combination with Sourceforge.
    — Sjors, http://dazjorz.com/
Please reply to list if it's a mailing list post - http://shlom.in/reply .
Shlomi Fish
2013-09-08 16:04:56 UTC
Permalink
Hi Ovid,

On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
Post by Ovid
Here's a complete example of a TAP::Harness plugin to create a red/green progress bar.
http://blogs.perl.org/users/ovid/2010/05/making-testharness-output-a-progress-bar.html
Thanks!

I'll take a look.

Regards,

Shlomi Fish
Post by Ovid
Cheers,
Ovid
 
--
IT consulting, training, international recruiting
       http://www.allaroundtheworld.fr/.
Buy my book! - http://bit.ly/beginning_perl
Live and work overseas - http://www.overseas-exile.com/
________________________________
Sent: Friday, 6 September 2013, 17:16
Subject: How to Port
https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames to
TAP::Harness
Hi all,
I'd like to know what is the best way to create a plugin for
https://metacpan.org/module/TAP::Harness which will behave similarly to
https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames . I
found out that the runtests method can accept aliases to be displayed
instead of the filename itself using an arrayref of [ $test, $alias ], so I
can simply wrap runtests() in a subclass, process the arguments, and call
next::method with the modified arguments.
However, I still don't know how to write a plugin like that exactly (and how
to get prove to recognise it). This section -
https://metacpan.org/module/TAP::Harness#WRITING-PLUGINS - explains a bit
about how to do that with some hand-waving, but does not show any complete
top-to-bottom example, and I could not find anything with a metacpan search.
My motivation for doing this is to port the rest of the functionality I miss
in Test::Run (which failed to gain mainstream acceptance, and few people
aside from me are using it) into TAP::Harness.
Regards,
    Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish      http://www.shlomifish.org/
Selina Mandrake - The Slayer (Buffy parody) - http://shlom.in/selina
bzr is slower than Subversion in combination with Sourceforge.
    — Sjors, http://dazjorz.com/
Please reply to list if it's a mailing list post - http://shlom.in/reply .
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Interview with Ben Collins-Sussman - http://shlom.in/sussman

Daniel: Yeah, those guys [= NSA] don’t publish…
Andrew: They perish, man.
— http://www.shlomifish.org/humour/Summerschool-at-the-NSA/

Please reply to list if it's a mailing list post - http://shlom.in/reply .
Shlomi Fish
2013-09-20 18:29:02 UTC
Permalink
Hi Ovid,

On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
Post by Ovid
Here's a complete example of a TAP::Harness plugin to create a red/green progress bar.
http://blogs.perl.org/users/ovid/2010/05/making-testharness-output-a-progress-bar.html
I read that post and have one question: can I easily create several specialised
plugins and have them all apply their modified behaviours to the relevant part
of TAP::Harness? Seems like I can only set up a single subclass of the relevant
parts in each plugin (like for the formatter or whatever). Or am I missing
something?

I'm asking because with Test::Run, I can set up more than one plugin for each
class and I'm wondering how to do that with TAP::Harness.

Regards,

Shlomi Fish
Post by Ovid
Cheers,
Ovid
 
--
IT consulting, training, international recruiting
       http://www.allaroundtheworld.fr/.
Buy my book! - http://bit.ly/beginning_perl
Live and work overseas - http://www.overseas-exile.com/
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Freecell Solver - http://fc-solve.shlomifish.org/

If his programming is anything like his philosophising, he would find ten
imaginary bugs in the “Hello World” program.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
Shlomi Fish
2013-11-02 05:41:48 UTC
Permalink
Hi all,

can someone (Ovid?) please reply to this post I wrote? I really would like to
know.

Regards,

Shlomi Fish

On Fri, 20 Sep 2013 21:29:02 +0300
Post by Shlomi Fish
Hi Ovid,
On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
Post by Ovid
Here's a complete example of a TAP::Harness plugin to create a red/green progress bar.
http://blogs.perl.org/users/ovid/2010/05/making-testharness-output-a-progress-bar.html
I read that post and have one question: can I easily create several
specialised plugins and have them all apply their modified behaviours to the
relevant part of TAP::Harness? Seems like I can only set up a single subclass
of the relevant parts in each plugin (like for the formatter or whatever). Or
am I missing something?
I'm asking because with Test::Run, I can set up more than one plugin for each
class and I'm wondering how to do that with TAP::Harness.
Regards,
Shlomi Fish
Post by Ovid
Cheers,
Ovid
 
--
IT consulting, training, international recruiting
       http://www.allaroundtheworld.fr/.
Buy my book! - http://bit.ly/beginning_perl
Live and work overseas - http://www.overseas-exile.com/
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Selina Mandrake - The Slayer (Buffy parody) - http://shlom.in/selina

Larry Wall has been changing the world. By modifying its very source code.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
Shlomi Fish
2013-11-26 07:33:29 UTC
Permalink
Hi all,

On Fri, 20 Sep 2013 21:29:02 +0300
Post by Shlomi Fish
Hi Ovid,
On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
Post by Ovid
Here's a complete example of a TAP::Harness plugin to create a red/green progress bar.
http://blogs.perl.org/users/ovid/2010/05/making-testharness-output-a-progress-bar.html
I read that post and have one question: can I easily create several
specialised plugins and have them all apply their modified behaviours to the
relevant part of TAP::Harness? Seems like I can only set up a single subclass
of the relevant parts in each plugin (like for the formatter or whatever). Or
am I missing something?
I'm asking because with Test::Run, I can set up more than one plugin for each
class and I'm wondering how to do that with TAP::Harness.
Can anyone please answer that question?

Regards,

Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Escape from GNU Autohell - http://www.shlomifish.org/open-source/anti/autohell/

I’d do Windows-- , but this may result in an integer underflow.
— an Israeli Linuxer.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
Leon Timmermans
2013-11-26 13:00:30 UTC
Permalink
Post by Shlomi Fish
I read that post and have one question: can I easily create several specialised
plugins and have them all apply their modified behaviours to the relevant part
of TAP::Harness? Seems like I can only set up a single subclass of the relevant
parts in each plugin (like for the formatter or whatever). Or am I missing
something?
I'm asking because with Test::Run, I can set up more than one plugin for each
class and I'm wondering how to do that with TAP::Harness.
I think you may want to write a set of subclasses with the appropriate
hooks (e.g. a TAP::Formatter::Extensible), and use that to write plugins
for.

Leon
Shlomi Fish
2013-11-28 08:39:02 UTC
Permalink
On Tue, 26 Nov 2013 14:00:30 +0100
Post by Leon Timmermans
Post by Shlomi Fish
I read that post and have one question: can I easily create several specialised
plugins and have them all apply their modified behaviours to the relevant part
of TAP::Harness? Seems like I can only set up a single subclass of the relevant
parts in each plugin (like for the formatter or whatever). Or am I missing
something?
I'm asking because with Test::Run, I can set up more than one plugin for each
class and I'm wondering how to do that with TAP::Harness.
I think you may want to write a set of subclasses with the appropriate
hooks (e.g. a TAP::Formatter::Extensible), and use that to write plugins
for.
Leon
Hi Leon,

thanks for the response, but I think I'll wait for a definitive answer from
Ovid, who originally wrote TAP::Harness, so I'll know whether I need to invest
the extra effort in doing that. Sorry if you're disappointed.

Regards,

Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Free (Creative Commons) Music Downloads, Reviews and more - http://jamendo.com/

What does “IDK” stand for? I don’t know.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
Ovid
2013-11-29 09:11:23 UTC
Permalink
Hi Shlomi,

My definitive answer would be to say "work with Leon" on this :) He's taken over maintenance on TAP::Harness. I haven't looked at that section of the code in quite some time and honestly, I don't have the time/energy to do so right now.
 
Best,
Ovid
--
IT consulting, training, international recruiting
       http://www.allaroundtheworld.fr/.
Buy my book! - http://bit.ly/beginning_perl
Live and work overseas - http://www.overseas-exile.com/



On Thursday, 28 November 2013, 9:39, Shlomi Fish <***@shlomifish.org> wrote:

On Tue, 26 Nov 2013 14:00:30 +0100
Post by Shlomi Fish
Post by Leon Timmermans
Post by Shlomi Fish
I read that post and have one question: can I easily create several specialised
plugins and have them all apply their modified behaviours to the relevant part
of TAP::Harness? Seems like I can only set up a single subclass of the relevant
parts in each plugin (like for the formatter or whatever). Or am I missing
something?
I'm asking because with Test::Run, I can set up more than one plugin for each
class and I'm wondering how to do that with TAP::Harness.
I think you may want to write a set of subclasses with the appropriate
hooks (e.g. a TAP::Formatter::Extensible), and use that to write plugins
for.
Leon
Hi Leon,
thanks for the response, but I think I'll wait for a definitive answer from
Ovid, who originally wrote TAP::Harness, so I'll know whether I need to invest
the extra effort in doing that. Sorry if you're disappointed.
Regards,
    Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish      http://www.shlomifish.org/
Free (Creative Commons) Music Downloads, Reviews and more - http://jamendo.com/
What does “IDK” stand for? I don’t know.
Please reply to list if it's a mailing list post - http://shlom.in/reply .
Shlomi Fish
2013-11-29 10:28:10 UTC
Permalink
On Fri, 29 Nov 2013 01:11:23 -0800 (PST)
Post by Ovid
Hi Shlomi,
My definitive answer would be to say "work with Leon" on this :) He's taken
over maintenance on TAP::Harness. I haven't looked at that section of the
code in quite some time and honestly, I don't have the time/energy to do so
right now. Best, Ovid
OK, thanks for the reply and the clarification. I will work with Leon on it.

Regards,

Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Funny Anti-Terrorism Story - http://shlom.in/enemy

<Su-Shee> Absolutely. Also: a German dog barks “wau” and a cat meows “miau”
<rindolf> Su-Shee: German animals are true German patriots.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
Steffen Schwigon
2013-09-10 12:01:20 UTC
Permalink
Only hint I have is my own

https://metacpan.org/release/App-Prove-Plugin-Idempotent

not sure it helps you with your precise problem.

Kind regards,
Steffen
Post by Shlomi Fish
Hi all,
I'd like to know what is the best way to create a plugin for
https://metacpan.org/module/TAP::Harness which will behave similarly to
https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames . I found
out that the runtests method can accept aliases to be displayed instead of the
filename itself using an arrayref of [ $test, $alias ], so I can simply wrap
runtests() in a subclass, process the arguments, and call next::method with the
modified arguments.
However, I still don't know how to write a plugin like that exactly (and how to
get prove to recognise it). This section -
https://metacpan.org/module/TAP::Harness#WRITING-PLUGINS - explains a bit about
how to do that with some hand-waving, but does not show any complete
top-to-bottom example, and I could not find anything with a metacpan search.
My motivation for doing this is to port the rest of the functionality I miss in
Test::Run (which failed to gain mainstream acceptance, and few people
aside from me are using it) into TAP::Harness.
Regards,
Shlomi Fish
--
Steffen Schwigon <***@renormalist.net>
Loading...