Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to see stderr of a test executable? #228

Closed
4 tasks done
emmenlau opened this issue Oct 15, 2020 · 5 comments
Closed
4 tasks done

How to see stderr of a test executable? #228

emmenlau opened this issue Oct 15, 2020 · 5 comments

Comments

@emmenlau
Copy link

Checklist

  • The issue is about this extension and NOT about a fork.
  • Check the known issues list.
  • The latest version of the extension was used.
  • It is not related to remote-vscode or I checked the following issue

Describe the bug

We are overall very happy with this extension, thanks a lot for the great work!

There is one problem that is plaguing us: Many tests for us write to stderr in case of problems, not stdout. This output is not showing in the OUTPUT tab of VSCode for us. Is there an option to enable capturing stderr, or this is a bug?

We do see the output coming from stdout, and when changing a message to print to stdout instead of stderr everything works. But especially the important messages are on stderr, so this is very unfortunate.

To Reproduce

Example:
1. Implement a test that prints to stderr, like std::cerr << "Hello world" << std::endl;
2. Run the test from this extension
3. Click on the test in this extension, to see the OUTPUT tab
4. There are all the "standard" messages from stdout, like [ RUN ] and [ FAILED ] from GTest. But the message from stderr is not printed.

Desktop

  • Extension Version: 3.4.2
  • VS Code Version: 1.50.0
  • Catch2 / Google Test / DOCTest Version: Google Test v1.10.0
  • OS Type and Version: Linux Ubuntu 20.04
  • Using remote-ssh/docker/wsl?: No
@matepek
Copy link
Owner

matepek commented Oct 16, 2020

Hey,
stderr is handled but it arrives too late. Need a bit bigger refactoring (if it even possible) to circumvent the issue.

@emmenlau
Copy link
Author

Thanks, thats very interesting! Usually stderr is faster because its not buffered so heavily, but I can see that for an extension it might be different...

@matepek
Copy link
Owner

matepek commented Oct 16, 2020

I subscribe for stderr and when I debug I can see the error arriving but the "[ FAILED ]" line has already arrived from stdout and processed so I cannot associate like this. Have to google more about NodeJS.

@matepek
Copy link
Owner

matepek commented Oct 31, 2020

It's nodejs stuff. Wont happen soon. :/

@matepek
Copy link
Owner

matepek commented Nov 1, 2020

Workaround from version > 3.6.0:

"executionWrapper": {
  "path": "/bin/sh",
  "args": [ "-c", "${cmd} ${argsStr} 2>&1" ]
}

@matepek matepek closed this as completed Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants