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

Getting support for fork() tests #644

Closed
Qix- opened this issue Apr 20, 2016 · 1 comment
Closed

Getting support for fork() tests #644

Qix- opened this issue Apr 20, 2016 · 1 comment

Comments

@Qix-
Copy link

Qix- commented Apr 20, 2016

So I have a few projects where I'm using Catch, and one or both of them require me to do some sort of operation that fork()'s the current process.

Needless to say, it's messy.

Since Catch is now running in two processes, two sets of output occur, which usually always results in one of them failing due to the child process getting signaled or something (especially if we try to exit()). The current fix is to close(1); to silence catch in the forked process, but that's not ideal.

What would be great is to see catch detect when it's being run inside of a fork and act accordingly - perhaps this means just silencing itself or not responding to signals. Or, better yet, format output accordingly.

Even better would be to have the parent process detect that it has forked and force the child process to open up a new file descriptor (FIFO or pipe or something) to write error messages to that the parent process can parse and use.

I know this would require a lot of work but by golly this would make Catch absolutely perfect. Even being able to detect if a forked process hasn't quit when we've reached the end of a SECTION() {} would be damn amazing.

Just a thought.

@horenmar
Copy link
Member

Since this will not be added to Catch Classic, but might be added to Catch 2 at some point, I opened #853 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants