nysus has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to make my test output from Test::More more user friendly. I've got this output from one of my tests:

ok 1 - module checks ok 2 - Should die if not passed an argument ok 3 - Can create new object # Subtest: attribute check ok 1 - has attribute: root_dir ok 2 - has type Str ok 3 - is ro ok 4 - is lazy ok 5 - has attribute: apache_config_path <snip> goes on for 56 more lines and fills my screen.

This one subtest basically fills my screen. I'm wondering how I might tame the output so only tests that fail show.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re: A way to suppress output of passed tests in a subtest with Test::More?
by haukex (Archbishop) on Mar 02, 2017 at 16:32 UTC
    I'm wondering how I might tame the output so only tests that fail show.

    The simplest way I know of is to use prove, as previously discussed.

      OK, just glanced at the docs. I ran !:prove and it magically worked and tests the files in my /t directory. Nice. I can work with this.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks

        From vim:
        !prove -l t/
        Too bad you didn't listen when you were told this months ago. Maybe you will start listening now?

      Yes, this prove beast you speak of, I keep seeing it referred to. I avoid it because it keeps talking about this "Tap Harness" stuff which makes me want to hide under my covers. I've got my vim set up running perfectly so I can test my module with the push of a button and now I'm afraid I will have to redo everything to implement prove. Will I have to?

      My current set up is I've got my perl module open in vim and I hit <F7> which triggers a nifty little vim script that searches for and runs all the tests it finds in a directory (vim script written by Damian Conway). The tests output springs open in a new buffer window split to the right of my code and I have it perfectly syntax highlighted to my liking.

      Am I going to have to undo my perfect little set up in order to use prove?

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks