Catch2: Allow multiple reporters with multiple output files

Created on 2 Aug 2019  路  1Comment  路  Source: catchorg/Catch2

Description

There have been requests for specifying multiple reporters to be used for the same test run. This was implemented for a while, but it ran into trouble caused by the fact that there was no way to give them different output files/streams for them to write to. If we reintroduce this possibility, we also need to decide on a syntax that allows different reporters to write to different files/streams.

Additional context
Possible syntaxes:

  • -r takes a list, -o takes a list, the size of list in -r must be at most 1 longer than the one in -o. Reporters are then given the targets from -o in the same order they are specified.
    Examples: -r junit xml -o junit.out -> junit reporter writes to the file junit.out, xml reporter writes to stdout.
  • -r takes a list of reporters, where the name can be followed by a colon and the name of the output file, e.g. -r junit:junit.out would say that the junit reporter should write its output to junit.out. Stdout would then be specified as either -, or without any followup after the name.

We also need to decide what to do if multiple reporters would be writing to stdout -- ignore it? Warn the user? Error out?

Feature Request

Most helpful comment

Personally i would go with second option.
It would be less prone to errors in defining of the reporters order.
Stdout could be specified by leaving out the optional :<filename> part.

I would go with error for mutliple reporters writing to stdout.

>All comments

Personally i would go with second option.
It would be less prone to errors in defining of the reporters order.
Stdout could be specified by leaving out the optional :<filename> part.

I would go with error for mutliple reporters writing to stdout.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zwcloud picture zwcloud  路  5Comments

hassanfarid picture hassanfarid  路  6Comments

maiermic picture maiermic  路  7Comments

jmeekhof picture jmeekhof  路  4Comments

Minoru picture Minoru  路  6Comments