Can `detail::throwException()` and `detail::TestFailureException` be made public?
This would solve 2 problems. The more important one is that when shimming in doctest under our existing testing API I need to support the equivalent of REQUIRE_EQ(a, b) << "optionally" << stream << "some" << stuff;. I've been able to do that with DOCTEST_CONFIG_ASSERTS_RETURN_VALUES and expanding our macro to if (CHECK_EQ(a,b)) {} else Thrower() <<= Streamer() where operator<<= calls doctest::detail::throwException();. But of course I would prefer not to rely on implementation details if it can be avoided.
Another use case that requires making the exception public is that some of our components define their own unittest helpers. And of course they want to test those helpers. So they have code like ASSERT_FAILS(ASSERT_FOO(x)). Right now the only option is to use catch(const std::exception&) {throw;} catch(...) {}, but it would be better to only swallow the precisely expected exception.
I can see your use case, but I'm not sure it's a good idea to formalise how doctest chooses to manage control flow. There's no harm in relying on detail:: members if you pin to an exact version, since that's exactly what you're spending on -- implementation detail.