A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)
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.
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 toclose(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.