Add gtest
[platform/core/appfw/message-port.git] / test / unit_tests / main.cc
1 // Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
4
5 #include <gtest/gtest.h>
6 #include <gmock/gmock.h>
7
8 int main(int argc, char** argv) {
9   int ret = -1;
10   try {
11     testing::InitGoogleTest(&argc, argv);
12   } catch(...) {
13     std::cout << "Exception occurred" << std::endl;
14   }
15
16   try {
17     ret = RUN_ALL_TESTS();
18   } catch (const ::testing::internal::GoogleTestFailureException& e) {
19     ret = -1;
20     std::cout << "GoogleTestFailureException was thrown:" << e.what()
21               << std::endl;
22   }
23
24   return ret;
25 }