You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL, I linked an executable containing the test runner implementation into a shared library containing the tests but when running the executable no tests are registered. Is this a supported use case?
I'm compiling with fvisibility=hidden if that makes a difference.
well such a scenario should be supported, but is the library necessary to the executable at all or is it only full of tests? Tests are self-registered upon startup but perhaps the entire library isn't necessary for the executable - try explicitly referencing a function in the executable which is defined in the dynamic library. If nothing defined in the library is explicitly referenced by the executable then the linker will optimize the library out - self-registering code in the library doesn't count... this is a common problem with static libraries and object files too.
Doctest will work fine even if you explicitly load the dll as a plugin using LoadLibrary btw...
I got it working, had a few typos that caused problems. I also had to export and reference a function to get it to work. Thanks for the quick response.
When using
DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL
, I linked an executable containing the test runner implementation into a shared library containing the tests but when running the executable no tests are registered. Is this a supported use case?I'm compiling with
fvisibility=hidden
if that makes a difference.Executable source code + cmake:
external/doctest/main.cpp
:test.cpp
:The text was updated successfully, but these errors were encountered: