in reply to Need advice on test output

Is it worth the work to provide default output as shown and allow configuration options to change what is shown and how it is shown?

Stimulated by a recent Q&A post I wonder if format could be pressed into service to provide user specified formatting? Combined with control over the data provided, that would allow pretty full on control over formatting, albeit in a slightly archaic fashion.

Alternatively a format string for printf could be provided by the user, again with user control over the data provided.

Both these techniques imply that multiple format strings or pictures are provided to allow control over different report line types.


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Need advice on test output
by Ovid (Cardinal) on Jan 05, 2007 at 11:16 UTC

    A format string for 'printf' would be difficult as there are a lot of conditional bits which won't get displayed if they're not present (such as 'unexpectedly succeeded tests'). Perhaps allowing an optional Template Toolkit template might work. However, TAPx::Parser very deliberately does not use any non-core modules and strives to be compatible with versions of Perl as old as 5.005, so this also limits my options.

    Cheers,
    Ovid

    New address of my CGI Course.

      Sorry, I didn't make that very clear did I? I meant to imply a format string per default summary line type. So the table format could easily be altered with column orders specified in a list of column names for example. This works pretty well if the column information happens to be stored in a hash, but it it pretty trivial to use a hash to map from a list of names to an index in any case.

      Report information that by default was suppressed would still be suppressed, but a specific format string could be supplied if required.


      DWIM is Perl's answer to Gödel