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

Disabling signals is broken in V3 #2791

Open
petermost opened this issue Jan 8, 2024 · 1 comment
Open

Disabling signals is broken in V3 #2791

petermost opened this issue Jan 8, 2024 · 1 comment

Comments

@petermost
Copy link

Describe the bug
It is not possible to disable signals in Catch2 V3 when it is prebuild into a static library.

Expected behavior
In V2 it was possible to disable signals/SEH with defining CATCH_CONFIG_NO_POSIX_SIGNALS and CATCH_CONFIG_NO_WINDOWS_SEH because it was a header only library. It would be nice if this would also possible for V3 without the need to build the library yourself.

Reproduction steps
The problem is also described here:
#1295 (comment)
The example code is trying to disable the signals like in V2, but in V3 these defines need to be defined when building the library itself.

Platform information:

  • OS: Linux / Windows
  • Catch version: v3

Additional context
I'm maintaining a fork of Sourcetrail which contains tests for JNI/JVM function calls. The JVM is internally using signals and this will lead to test failures because Catch2 intercepts these signals and reports a SIGSEGV.

I probably don't need to mention this, but this issue might become more urgent when Debian/Ubuntu starts to deploy a prebuild Catch2 V3 via their repositories.

@AlexisWilke
Copy link

I concur. The current implementation uses the same compile time flag (CATCH_CONFIG_NO_POSIX_SIGNALS) but since we now have a compiled version of the library, trying to change that flag in each individual project is futile.

On my end, I'll look to having two versions available for my projects. I have a couple of libraries where I want to be able to test Unix signals and as it stands, Catch2 v3 prevents me from doing it. It's a rather rare situation, but certainly useful to properly document if it is not going to be possible to switch the library one way or the other when used in different projects.

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