use CMAKE_INSTALL_LIBDIR instead of "/usr/lib"
[profile/ivi/smartdevicelink.git] / test / test_suit.cc
1 /**
2  * Copyright (c) 2013, Ford Motor Company
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * Redistributions of source code must retain the above copyright notice, this
9  * list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following
13  * disclaimer in the documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of the Ford Motor Company nor the names of its contributors
17  * may be used to endorse or promote products derived from this software
18  * without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32
33 #include "gtest/gtest.h"
34 #include "gmock/gmock.h"
35
36 #include "config_profile/profile.h"
37 #include "utils/logger.h"
38
39 #include "utils/file_system_tests.h"
40 #include "utils/data_time_tests.h"
41 #include "utils/prioritized_queue_tests.h"
42 #include "protocol_handler/protocol_handler_tm_test.h"
43 #include "application_manager/formatters_commands.h"
44 #include "SmartObjectDraftTest.h"
45 #include "SmartObjectInvalidTest.h"
46 #include "SmartObjectStressTest.h"
47 #include "SmartObjectUnitTest.h"
48 #include "TSharedPtrTest.h"
49 //#include "media_manager/media_manager_impl_test.h"
50 //#include "jsoncpp/json_reader_test.h"
51
52 // #include "json_handler/smart_schema_draft_test.h"
53 // #include "SmartObjectConvertionTimeTest.h"
54 // #include "request_watchdog/request_watchdog_test.h"
55 // #include "json_handler/formatters/formatter_test_helper.h"
56 // #include "json_handler/formatters/formatter_json_alrpcv1_test.h"
57 // #include "json_handler/formatters/formatter_json_alrpcv2_test.h"
58 // #include "json_handler/formatters/formatter_json_rpcv2_test.h"
59
60 #ifdef TESTS_WITH_HMI
61 #include "hmi_message_handler/hmi_message_handler.h"
62 #include "life_cycle.cc"
63 #include "rpc/admin_app_test.h"
64 #include "utils/threads/thread.h"
65 #include "utils/threads/thread_options.h"
66 #include "rpc/test_app_manager.h"
67 #endif
68
69 // #define QT_HMI
70
71 #ifdef __cplusplus
72 extern "C" void __gcov_flush();
73 #endif
74
75 int main(int argc, char **argv) {
76   ::testing::InitGoogleMock(&argc, argv);
77
78   profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
79   INIT_LOGGER("log4cxx.properties");
80
81 #ifdef TESTS_WITH_HMI
82   test::AdminAppTest app;
83
84   app.Run();
85   sleep(5);
86 #endif
87   int result = RUN_ALL_TESTS();
88
89 #if defined(__cplusplus) and defined(GCOV_ENABLED)
90   __gcov_flush();
91 #endif
92
93   sleep(2);
94   return result;
95 }