From: SooChan Lim Date: Thu, 4 Jan 2018 02:40:25 +0000 (+0900) Subject: utest: cactch GoogleTestFailureException X-Git-Tag: submit/tizen/20180108.015805~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7cc6f639e01e1121f2522cf560bf42e9892af21d;p=platform%2Fcore%2Fuifw%2Flibtdm.git utest: cactch GoogleTestFailureException Change-Id: Ia137c1ba715b29ac7385f55218d51ca880f62fcc --- diff --git a/utests/src/ut_main.cpp b/utests/src/ut_main.cpp index 6443f33e..c056a2f1 100644 --- a/utests/src/ut_main.cpp +++ b/utests/src/ut_main.cpp @@ -32,6 +32,8 @@ int main(int argc, char **argv) { + auto AllTestSuccess = false; + try { ::testing::InitGoogleTest(&argc, argv); ::testing::FLAGS_gtest_death_test_style = "fast"; @@ -39,5 +41,14 @@ int main(int argc, char **argv) std::cout << "error while trying to init google tests.\n"; exit(EXIT_FAILURE); } - return RUN_ALL_TESTS(); -} + + try { + AllTestSuccess = RUN_ALL_TESTS() == 0 ? true : false; + } catch (const ::testing::internal::GoogleTestFailureException& e) { + AllTestSuccess = false; + std::cout << "GoogleTestFailureException was thrown:"<< e.what() << std::endl; + std::cout << "\n"; + } + + return AllTestSuccess; +} \ No newline at end of file