Commit bb79a9be authored by Jeff Thomas's avatar Jeff Thomas Committed by Facebook GitHub Bot

Dump async stacks on uncaught exception from CO_TEST_

Summary: Dump async stacks on uncaught exception from CO_TEST_

Reviewed By: ispeters

Differential Revision: D29775971

fbshipit-source-id: 80e349aa411d8b866747d1821b215adfbc51b53f
parent 4548ec7b
......@@ -19,6 +19,7 @@
#include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/Coroutine.h>
#include <folly/experimental/coro/Task.h>
#include <folly/experimental/exception_tracer/SmartExceptionTracer.h>
#include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
......@@ -70,7 +71,13 @@
new ::testing::internal::TestFactoryImpl<GTEST_TEST_CLASS_NAME_( \
test_suite_name, test_name)>); \
void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody() { \
try { \
folly::coro::blockingWait(co_TestBody()); \
} catch (const std::exception& ex) { \
GTEST_LOG_(ERROR) << ex.what() << ", async stack trace: " \
<< folly::exception_tracer::getAsyncTrace(ex); \
throw; \
} \
} \
folly::coro::Task<void> GTEST_TEST_CLASS_NAME_( \
test_suite_name, test_name)::co_TestBody()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment