diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-26 13:38:24 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-26 13:38:24 +0300 |
commit | d5542c891803641fb11f2edf0d71e6004a5e9c38 (patch) | |
tree | 592fd52d5412775f103fab3beb0083c08de7837f /library/cpp/testing/unittest/registar.h | |
parent | e42e29335e2001970f95535e7557d5c27519f29f (diff) | |
download | ydb-d5542c891803641fb11f2edf0d71e6004a5e9c38.tar.gz |
intermediate changes
ref:ba3b994bce107b5d5ed74af8bebe6df02576505a
Diffstat (limited to 'library/cpp/testing/unittest/registar.h')
-rw-r--r-- | library/cpp/testing/unittest/registar.h | 16 |
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_); \ } \ |