vberlier/narwhal

Show stdout and stderr output regardless of test result

eerimoq opened this issue · 5 comments

Hello,

I often want to see all stdout and stderr output regardless of the test result. There are two reasons; I like printf-debugging and I want to see the output from the project's logging module. Would it be possible to add support for it somehow? Maybe write the output to a file, maybe to the terminal, maybe something else. Maybe a command line argument to enable it?

Hmm... depending on the use-case I can see this being implemented a bit like the ONLY and SKIP modifiers. It wouldn't be too hard to add an INSPECT modifier that displays the output of a specific test even when it succeeds.

TEST(example, INSPECT)
{
    printf("hello\n");
}

Otherwise, if it's about generating a dump of all the outputs of your tests on every run it means that I'd need to setup some sort of global configuration and make it possible to enable the option with a command-line argument or an environment variable depending on whether the user defined a custom main function or not.

I would prefer a global configuration to easily get all output of the whole suite.

Should the dump be machine-readable? Like a big json file?

The raw, unmodified, output is what I am looking for.

@vberlier Is there anyway to have this work? To simply have stdout and stderr being printed as expected?