int main(int argc, char **argv)
{
+ auto AllTestSuccess = false;
+
try {
::testing::InitGoogleTest(&argc, argv);
::testing::FLAGS_gtest_death_test_style = "fast";
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