--- a/test/test_duplex.cpp +++ b/test/test_duplex.cpp @@ -18,6 +18,8 @@ #include #include +#include "mozilla/gtest/MozHelpers.h" + // #define ENABLE_NORMAL_LOG // #define ENABLE_VERBOSE_LOG #include "common.h" @@ -201,6 +203,11 @@ ASSERT_EQ(r, CUBEB_OK); } +void CauseDeath(cubeb * p) { + mozilla::gtest::DisableCrashReporter(); + cubeb_destroy(p); +} + #ifdef GTEST_HAS_DEATH_TEST TEST(cubeb, duplex_collection_change_no_unregister) { @@ -218,9 +225,17 @@ } std::unique_ptr cleanup_cubeb_at_exit( - ctx, [](cubeb * p) noexcept { EXPECT_DEATH(cubeb_destroy(p), ""); }); + ctx, [](cubeb * p) noexcept { EXPECT_DEATH(CauseDeath(p), ""); }); duplex_collection_change_impl(ctx); + +# if defined(XP_MACOSX) && !defined(MOZ_DEBUG) + // For some reason this test hangs on macOS in non-debug builds when the child + // process (death test fork) crashes and the crash reporter is enabled in the + // parent process. There is not much left to do that can cause a crash in the + // parent process anyway, so disable the crash reporter where needed to pass. + mozilla::gtest::DisableCrashReporter(); +# endif } #endif