google / googletest

GoogleTest - Google Testing and Mocking Framework
https://google.github.io/googletest/
BSD 3-Clause "New" or "Revised" License
34.51k stars 10.09k forks source link

Death Test on iOS #2834

Open dipidoo opened 4 years ago

dipidoo commented 4 years ago

googletest does not support EXPECT_DEATH on iOS platform, see how it tests for !GTEST_OS_IOS: https://github.com/google/googletest/blob/0eea2e9fc63461761dea5f2f517bd6af2ca024fa/googletest/include/gtest/internal/gtest-port.h#L592

Recently, I tried to force define GTEST_HAS_DEATH_TEST on GSL, see https://github.com/dipidoo/GSL/commit/91858ca3f32c4c7d7704b7ed72043caa451377a3. The tests run normally and successfully https://github.com/dipidoo/GSL/runs/644183147?check_suite_focus=true#step:7:459

If googletest now supports EXPECT_DEATH on iOS platform, I could remove the !GTEST_OS_IOS check. Let me know.

vslashg commented 4 years ago

I'm running tests on our internal codebase to see if anything breaks with this change. If it comes back clean, I'll have to do a little digging to see how far back we can get away with this, and figure out whether we need a more sophisticated change to the #if.

dipidoo commented 4 years ago

By “how far back” did you mean iOS version? Let me know of anything I may be able to assist with. This change was added by https://github.com/google/googletest/commit/a1c4b46bc2c12ea7c61108f001a5b5eb4a8ccad0 in https://github.com/google/googletest/pull/498 8 years ago in iOS 5 era. The oldest I can help with would be iOS 8 simulator and iOS 10 device.