Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Separate stdout and stderr from the run output #231

Closed

Conversation

Marthym
Copy link

@Marthym Marthym commented Sep 12, 2017

Put all tested method output in the same variable is an alteration of the real method result.
For exemple :

testedMethod() {
  echo "the result"
  (>&2 echo "some log informations")
  return 0
}
value=$(testedMethod)

value contain only "the result" and when I use it in a script I'm only interested in "the result".
But it's not possible to assert only the stdout. It should be possible to assert separatly stdout and stderr.

That's why I propose this update.
In order to keep compatibility I juste add variables :

  • stdout: Only the stdout output
  • stderr: Only the stderr output
  • stdlines: stdout by line
  • errlines: stderr by line
  • output: Contain stdout+stderr concatenated

@ggiamarchi
Copy link

Any chance to see that PR merged?

@xmik
Copy link

xmik commented Oct 2, 2019

This repository is not actively maintained anymore, see a discussion here: #150 (comment)

Try https://github.com/bats-core/bats-core

@ggiamarchi
Copy link

Good to know. What a pity it's not explicitly mentioned at the very beginning of the README.

Thank you @xmik

@xmik
Copy link

xmik commented Oct 3, 2019

There are already at least 2 PRs trying to accomplish just that (to update README): #248 and #269 but no success so far

@Marthym Marthym closed this Mar 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants