GTest does not officially support dynamic loading
От: sergey2b ЮАР  
Дата: 29.11.25 02:22
Оценка:

Google Test (GTest)
does not officially support dynamic loading of tests within shared libraries (DLLs) using functions like LoadLibrary(). The problem arises because GTest uses static variables to register tests when the library is loaded, and attempting to unload and reload libraries or running the cleanup code after a library has been unloaded can cause a crash.


при написании тестов столкнулся с тем что при использовании GTest при вызове LoadLibrary возникает exception

подскажите пожалуйстта реально ли обойти эту проблемму
Re: GTest does not officially support dynamic loading
От: tapatoon  
Дата: 29.11.25 06:35
Оценка:
Здравствуйте, sergey2b, Вы писали:

S>

S>Google Test (GTest)
S>does not officially support dynamic loading of tests within shared libraries (DLLs) using functions like LoadLibrary(). The problem arises because GTest uses static variables to register tests when the library is loaded, and attempting to unload and reload libraries or running the cleanup code after a library has been unloaded can cause a crash.


У тебя тесты в dll чтоль? Вынести их в статическую либу и подсовывать её тестам и dll-ине?

PS. Как я понял, проблемы возникают при выгрузке dll, т.к. становится невалидной инфа про зарегистрированные тесты. А если её не выгружать?
Центр ИПсО Сил Специальных Операций
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.