FAQ
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 .

Search Discussions

  • Ovid at Sep 7, 2013 at 9:16 pm
    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/


    ________________________________
    From: Shlomi Fish <shlomif@shlomifish.org>
    To: perl-qa@perl.org
    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 at Sep 8, 2013 at 4:05 pm
    Hi Ovid,

    On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
    Ovid wrote:
    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

    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/


    ________________________________
    From: Shlomi Fish <shlomif@shlomifish.org>
    To: perl-qa@perl.org
    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 at Sep 20, 2013 at 6:29 pm
    Hi Ovid,

    On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
    Ovid wrote:
    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
    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 at Nov 2, 2013 at 5:41 am
    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
    Shlomi Fish wrote:
    Hi Ovid,

    On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
    Ovid wrote:
    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
    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 at Nov 26, 2013 at 7:33 am
    Hi all,

    On Fri, 20 Sep 2013 21:29:02 +0300
    Shlomi Fish wrote:
    Hi Ovid,

    On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
    Ovid wrote:
    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 at Nov 26, 2013 at 1:01 pm

    On Fri, Sep 20, 2013 at 8:29 PM, Shlomi Fish wrote:

    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 at Nov 28, 2013 at 8:39 am

    On Tue, 26 Nov 2013 14:00:30 +0100 Leon Timmermans wrote:
    On Fri, Sep 20, 2013 at 8:29 PM, Shlomi Fish wrote:

    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 at Nov 29, 2013 at 9:11 am
    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 wrote:

    On Tue, 26 Nov 2013 14:00:30 +0100
    Leon Timmermans wrote:
    On Fri, Sep 20, 2013 at 8:29 PM, Shlomi Fish wrote:

    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 at Nov 29, 2013 at 10:28 am

    On Fri, 29 Nov 2013 01:11:23 -0800 (PST) Ovid wrote:

    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 at Sep 10, 2013 at 12:01 pm
    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

    Shlomi Fish <shlomif@shlomifish.org> writes:
    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 <ss5@renormalist.net>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupqa @
categoriesperl
postedSep 6, '13 at 3:16p
activeNov 29, '13 at 10:28a
posts11
users4
websiteqa.perl.org

People

Translate

site design / logo © 2019 Grokbase