Not sure if you can make runner.t work with prove without altering run.t.raw slightly. It will if you change the raw file to make the last line conditional in a similar way to this:

#!perl use strictures; use Test::More; subtest "Prod" => sub { plan skip_all => "Set PROD_TEST to run" unless $ENV{PROD_TEST}; ok 1, "OHAI, PROD!"; done_testing(1); }; subtest "Dev" => sub { plan skip_all => "Set DEV_TEST to run" unless $ENV{DEV_TEST}; ok 1, "OHAI, DEV!"; done_testing(1); }; done_testing(2) if $0 =~ /run\.t\.raw/;

Then the runner can just become

#!perl # File: runner.t use strictures; use Test::More; for my $env (qw/ PROD DEV /) { my $test = join "_", $env, "TEST"; local $ENV{$test} = 1; do 'run.t.raw'; } done_testing (4);

I don't know if that's good enough for your criteria? Here's what happens when I run these:

$ perl run.t.raw # Subtest: Prod 1..0 # SKIP Set PROD_TEST to run ok 1 # skip Set PROD_TEST to run # Subtest: Dev 1..0 # SKIP Set DEV_TEST to run ok 2 # skip Set DEV_TEST to run 1..2 $ prove run.t.raw run.t.raw .. ok All tests successful. Files=1, Tests=2, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.02 cusr + 0.00 csys = 0.06 CPU) Result: PASS $ perl runner.t # Subtest: Prod ok 1 - OHAI, PROD! 1..1 ok 1 - Prod # Subtest: Dev 1..0 # SKIP Set DEV_TEST to run ok 2 # skip Set DEV_TEST to run # Subtest: Prod 1..0 # SKIP Set PROD_TEST to run ok 3 # skip Set PROD_TEST to run # Subtest: Dev ok 1 - OHAI, DEV! 1..1 ok 4 - Dev 1..4 $ prove runner.t runner.t .. ok All tests successful. Files=1, Tests=4, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.02 cusr + 0.00 csys = 0.05 CPU) Result: PASS $

In reply to Re: Test runner that acts like a test and can be run as one by hippo
in thread Test runner that acts like a test and can be run as one by Your Mother

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.