kill syscommand yields a failure in Catch2 test case

306 views Asked by At

I'm using Catch2 for testing in C++. My test case forks a child process and at some point the parent process sends a kill(pid, SIGTERM) to it to clean it up.

However, I get the following error from Catch2.

FAILED:
due to a fatal error condition:
  SIGTERM - Termination request signal

Of course I'm deliberately making this sys call so I don't consider it a test fail. How can I get Catch2 to ignore this failure condition?

Thanks!

1

There are 1 answers

0
Xarn On

You can disable POSIX signal handling by defining CATCH_CONFIG_NO_POSIX_SIGNALS during compilation.