aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/unittest/registar.h
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-26 13:38:24 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-26 13:38:24 +0300
commitd5542c891803641fb11f2edf0d71e6004a5e9c38 (patch)
tree592fd52d5412775f103fab3beb0083c08de7837f /library/cpp/testing/unittest/registar.h
parente42e29335e2001970f95535e7557d5c27519f29f (diff)
downloadydb-d5542c891803641fb11f2edf0d71e6004a5e9c38.tar.gz
intermediate changes
ref:ba3b994bce107b5d5ed74af8bebe6df02576505a
Diffstat (limited to 'library/cpp/testing/unittest/registar.h')
-rw-r--r--library/cpp/testing/unittest/registar.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h
index 4d5352e548..ac2bf5d514 100644
--- a/library/cpp/testing/unittest/registar.h
+++ b/library/cpp/testing/unittest/registar.h
@@ -7,6 +7,7 @@
#include <util/generic/intrlist.h>
#include <util/generic/map.h>
#include <util/generic/ptr.h>
+#include <util/generic/scope.h>
#include <util/generic/set.h>
#include <util/generic/typetraits.h>
#include <util/generic/vector.h>
@@ -962,10 +963,21 @@ public: \
this->BeforeTest(i->Name_); \
{ \
TCleanUp cleaner(this); \
- auto testCase = [&i, &context] { \
+ auto testCase = [this, &i, &context] { \
+ Y_DEFER { \
+ try { \
+ i->TearDown(context); \
+ } catch (const ::NUnitTest::TAssertException&) { \
+ } catch (const yexception& e) { \
+ CATCH_REACTION_BT(i->Name_, e, &context); \
+ } catch (const std::exception& e) { \
+ CATCH_REACTION(i->Name_, e, &context); \
+ } catch (...) { \
+ this->AddError("non-std exception!", &context); \
+ } \
+ }; \
i->SetUp(context); \
i->Execute_(context); \
- i->TearDown(context); \
}; \
this->T::Run(testCase, StaticName(), i->Name_, i->ForceFork_); \
} \