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

Issue with capturing stderr stream #70

Open
KamaroK opened this issue Jun 9, 2023 · 2 comments
Open

Issue with capturing stderr stream #70

KamaroK opened this issue Jun 9, 2023 · 2 comments

Comments

@KamaroK
Copy link

KamaroK commented Jun 9, 2023

I have an issue with this code

CESTER_CAPTURE_STDERR();
__wrap_infrsprin_(&n,rp,ip,c,&torq1);
cester_assert_stderr_stream_content_contain("constraint");
CESTER_RELEASE_STDERR();

that seems to not capture stderr stream content

@Thecarisma
Copy link
Member

You can use the macro CESTER_STDERR_CONTENT to print out the stderr content to see if anything is in it

printf("%s", CESTER_STDERR_CONTENT())

Or verify the output stream the function is printing into, if it is not stderr you can capture the stream manually

// stream can be stdout, stderr, a FILE handle, etc.
CESTER_CAPTURE_STREAM(stream);
__wrap_infrsprin_(&n,rp,ip,c,&torq1);
cester_assert_stream_content_contain(stream, "constraint");
CESTER_RELEASE_STREAM(stream);

I assume the function _wrap_infrsprin prints to a stream in the course of it execution.

@KamaroK
Copy link
Author

KamaroK commented Jun 12, 2023

The stderr content is not print out and cester do not capture any type of file handle or even stdout

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