Skip to content

New option to print parsed test file with actual stdout, stderr, and exit status #21

@schoettl

Description

@schoettl

Hi, I think it would be great to have an option --print-test-file-with-output which would print the test file together with the actual output, e.g.:

Running:

cat <<EOF > example.test
$ echo foo
>
bar

$ false

$ echo bar >&2

EOF
shelltest --print-test-file-with-output example.test

would yield this output:

$ echo foo
>
foo

$ false
>= 1

$ echo bar >&2
>2
bar

Example use:

shelltest --print-test-file-with-output example.test > tmp && mv tmp example.test
git diff

Or did I miss an option like that?

It would make it easy to generate expected results in new tests. We also could diff and review changes without manually updating parts of the test file.

I could probably implement this. But first a question: Can the program know, after parsing, what the shelltest input format was (v1, v2, v3)? So that it can generate the exact same format?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions