Skip to content

Allow only showing stdout or stderr when using --success-output and --failure-output #1688

@Kriskras99

Description

@Kriskras99

I'm writing a file parser and when I get a new version of the format I like to add the samples to my tests.
However, this means that the tests will start hitting todo!() and panic!() and this pollutes the output of the tests:

        FAIL [   0.004s] ubiart_toolkit::tape tape_parse_wiiu2015::base/tape.ckd/f054654bfd32299c39542c768be25c6e.tape.ckd

--- STDOUT:              ubiart_toolkit::tape tape_parse_wiiu2015::base/tape.ckd/f054654bfd32299c39542c768be25c6e.tape.ckd ---

running 1 test
test tape_parse_wiiu2015::base/tape.ckd/f054654bfd32299c39542c768be25c6e.tape.ckd ... FAILED

failures:

---- tape_parse_wiiu2015::base/tape.ckd/f054654bfd32299c39542c768be25c6e.tape.ckd ----
test panicked: not yet implemented


failures:
    tape_parse_wiiu2015::base/tape.ckd/f054654bfd32299c39542c768be25c6e.tape.ckd

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


--- STDERR:              ubiart_toolkit::tape tape_parse_wiiu2015::base/tape.ckd/f054654bfd32299c39542c768be25c6e.tape.ckd ---
thread '<unnamed>' panicked at ubiart_toolkit/src/cooked/tape/mod.rs:2087:9:
not yet implemented
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

In these cases stdout has no useful additional information compared to stderr, so I would like to disable it.
I was thinking of the following:

  • --failure-output immediate -> outputs both stdout and stderr (current case)
  • --failure-output stdout=never -> does not output to stdout, uses default for stderr
  • --failure-output stdout=never,stderr=immediate -> does not output to stdout, immediate output for stderr

Another option is adding more flags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions