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

GentleMonks,

I am seeking top tips for making test output beautiful; perhaps just some sort of colorizing will do.

I use basic test modules like Test::More, Test:Env, Test::Files, etc

thx in advance.

Replies are listed 'Best First'.
Re: test output in colour ?
by johngg (Canon) on Feb 11, 2008 at 14:54 UTC
Re: test output in colour ?
by Fletch (Bishop) on Feb 11, 2008 at 15:01 UTC

    Maybe Test::Builder::Tester::Color would be of interest?

    Worst case you probably could write a filter to postprocess your test output (i.e. something analogous to what colordiff does for diff output).

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re: test output in colour ?
by grinder (Bishop) on Feb 11, 2008 at 15:29 UTC

    I'm pretty sure you get this for free with Test::Harness 3.0. Upgrade that, and everything else should follow just nicely.

    • another intruder with the mooring in the heart of the Perl

      Yup, it's built-in. If we think the output isn't going to a terminal or if you don't have the correct modules installed, we disable the color output. You can also do this manually with the --nocolor switch.

      Cheers,
      Ovid

      New address of my CGI Course.

        The terminal detection is really annoying. I often pipe colorful output to `less -r'. If tools stopped istty() then my tools would work better. Same goes for ack.

        ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊