Release version 0.26.0
[platform/core/appfw/pkgmgr-info.git] / test / unit_tests / main.cc
1 // Copyright (c) 2021 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 #ifdef LOG_INTERNAL
9 #include <dlog.h>
10
11 extern "C" int __dlog_print(log_id_t log_id, int prio, const char *tag, const char *fmt, ...) {
12   printf("%s:", tag);
13   va_list ap;
14   va_start(ap, fmt);
15   vprintf(fmt, ap);
16   va_end(ap);
17   printf("\n");
18
19   return 0;
20 }
21 #endif
22
23 int main(int argc, char** argv) {
24   int ret = -1;
25   try {
26     testing::InitGoogleTest(&argc, argv);
27   } catch(...) {
28     std::cout << "Exception occurred" << std::endl;
29   }
30
31   try {
32     ret = RUN_ALL_TESTS();
33   } catch (const ::testing::internal::GoogleTestFailureException& e) {
34     ret = -1;
35     std::cout << "GoogleTestFailureException was thrown:" << e.what()
36               << std::endl;
37   }
38
39   return ret;
40 }