diff options
author | Elisey Zamakhov <EZamakhov@luxoft.com> | 2015-03-04 18:32:44 +0300 |
---|---|---|
committer | Elisey Zamakhov <EZamakhov@luxoft.com> | 2015-03-18 13:48:18 +0300 |
commit | 3fb3b2a03366eddea6d5658aaa7c8d9a360f5b71 (patch) | |
tree | 183ecdbc39f5d629734a383bfb418a8de5f2e0ed /src | |
parent | e1d6b9b88e412ea240e1cf9b5764bb5f67854bd9 (diff) | |
download | sdl_core-3fb3b2a03366eddea6d5658aaa7c8d9a360f5b71.tar.gz |
Add one test main.cc file with correct logger deinitialization
Diffstat (limited to 'src')
26 files changed, 11 insertions, 257 deletions
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt index 6c76af526a..f17f47d342 100644 --- a/src/components/application_manager/test/CMakeLists.txt +++ b/src/components/application_manager/test/CMakeLists.txt @@ -47,7 +47,6 @@ include_directories( ) set(testSources - ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/src/gmock_main.cc ${AM_TEST_DIR}/command_impl_test.cc ${COMPONENTS_DIR}/application_manager/test/mobile_message_handler_test.cc ${AM_TEST_DIR}/request_info_test.cc diff --git a/src/components/connection_handler/test/CMakeLists.txt b/src/components/connection_handler/test/CMakeLists.txt index e0c1fb38b4..49899aeb61 100644 --- a/src/components/connection_handler/test/CMakeLists.txt +++ b/src/components/connection_handler/test/CMakeLists.txt @@ -49,7 +49,6 @@ set(SOURCES connection_handler_impl_test.cc connection_test.cc heart_beat_monitor_test.cc - main.cc ) file(COPY ${appMain_DIR}/smartDeviceLink.ini DESTINATION "./") diff --git a/src/components/connection_handler/test/main.cc b/src/components/connection_handler/test/main.cc deleted file mode 100644 index 59fa20e8b5..0000000000 --- a/src/components/connection_handler/test/main.cc +++ /dev/null @@ -1,7 +0,0 @@ -#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/src/components/dbus/test/CMakeLists.txt b/src/components/dbus/test/CMakeLists.txt index 49e3d9f679..d96f2388fb 100644 --- a/src/components/dbus/test/CMakeLists.txt +++ b/src/components/dbus/test/CMakeLists.txt @@ -45,7 +45,6 @@ set (LIBRARIES set(testSources ${COMPONENTS_DIR}/dbus/test/test_schema.cc ${COMPONENTS_DIR}/dbus/test/test_dbus_adapter.cc - ${COMPONENTS_DIR}/dbus/test/main.cc ) create_test("test_DBus_test" "${testSources}" "${LIBRARIES}") diff --git a/src/components/dbus/test/main.cc b/src/components/dbus/test/main.cc deleted file mode 100644 index 59fa20e8b5..0000000000 --- a/src/components/dbus/test/main.cc +++ /dev/null @@ -1,7 +0,0 @@ -#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/src/components/formatters/test/CMakeLists.txt b/src/components/formatters/test/CMakeLists.txt index 8188e8104b..cbe9a2190e 100644 --- a/src/components/formatters/test/CMakeLists.txt +++ b/src/components/formatters/test/CMakeLists.txt @@ -46,7 +46,6 @@ set(LIBRARIES set(SOURCES ${COMPONENTS_DIR}/formatters/test/generic_json_formatter_test.cc -${COMPONENTS_DIR}/formatters/test/main.cc ) create_test("generic_json_formatter_test" "${SOURCES}" "${LIBRARIES}") diff --git a/src/components/formatters/test/main.cc b/src/components/formatters/test/main.cc deleted file mode 100644 index 59fa20e8b5..0000000000 --- a/src/components/formatters/test/main.cc +++ /dev/null @@ -1,7 +0,0 @@ -#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/src/components/hmi_message_handler/test/CMakeLists.txt b/src/components/hmi_message_handler/test/CMakeLists.txt index a8597b51bd..4a97e299f0 100644 --- a/src/components/hmi_message_handler/test/CMakeLists.txt +++ b/src/components/hmi_message_handler/test/CMakeLists.txt @@ -42,7 +42,6 @@ set(LIBRARIES ) set(SOURCES - ${COMPONENTS_DIR}/hmi_message_handler/test/main.cc ${COMPONENTS_DIR}/hmi_message_handler/test/mqueue_adapter_test.cc ) @@ -54,4 +53,4 @@ if(${QT_HMI}) endif() create_test("hmi_message_handler_test" "${SOURCES}" "${LIBRARIES}") -endif()
\ No newline at end of file +endif() diff --git a/src/components/hmi_message_handler/test/main.cc b/src/components/hmi_message_handler/test/main.cc deleted file mode 100644 index 3a4e919d02..0000000000 --- a/src/components/hmi_message_handler/test/main.cc +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2014, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#include "gmock/gmock.h" - -int main(int argc, char** argv) { - testing::InitGoogleMock(&argc, argv); - return RUN_ALL_TESTS(); -} - - - - diff --git a/src/components/media_manager/test/CMakeLists.txt b/src/components/media_manager/test/CMakeLists.txt index 5e5597e881..1146aacff0 100644 --- a/src/components/media_manager/test/CMakeLists.txt +++ b/src/components/media_manager/test/CMakeLists.txt @@ -44,7 +44,6 @@ endif() set(SOURCES media_manager_impl_test.cc - main.cc ) set(LIBRARIES diff --git a/src/components/media_manager/test/main.cc b/src/components/media_manager/test/main.cc deleted file mode 100644 index ed4c5e32b3..0000000000 --- a/src/components/media_manager/test/main.cc +++ /dev/null @@ -1,39 +0,0 @@ -/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/src/components/policy/test/CMakeLists.txt b/src/components/policy/test/CMakeLists.txt index 011a025341..20a367028c 100644 --- a/src/components/policy/test/CMakeLists.txt +++ b/src/components/policy/test/CMakeLists.txt @@ -51,7 +51,6 @@ set(testLibraries ) set(testSources - main.cc usage_statistics_test.cc shared_library_test.cc generated_code_test.cc #APPLINK-10657 diff --git a/src/components/policy/test/main.cc b/src/components/policy/test/main.cc deleted file mode 100644 index edfc998db8..0000000000 --- a/src/components/policy/test/main.cc +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2014, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "gmock/gmock.h" - -int main(int argc, char** argv) { - testing::InitGoogleMock(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/src/components/protocol_handler/test/CMakeLists.txt b/src/components/protocol_handler/test/CMakeLists.txt index f3373d13a7..d24fb47bac 100644 --- a/src/components/protocol_handler/test/CMakeLists.txt +++ b/src/components/protocol_handler/test/CMakeLists.txt @@ -46,7 +46,6 @@ set(LIBRARIES ) set(SOURCES - main.cc incoming_data_handler_test.cc protocol_header_validator_test.cc protocol_handler_tm_test.cc diff --git a/src/components/protocol_handler/test/main.cc b/src/components/protocol_handler/test/main.cc deleted file mode 100644 index 59fa20e8b5..0000000000 --- a/src/components/protocol_handler/test/main.cc +++ /dev/null @@ -1,7 +0,0 @@ -#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/src/components/rpc_base/test/CMakeLists.txt b/src/components/rpc_base/test/CMakeLists.txt index 6513cb55b7..583cf7c63e 100644 --- a/src/components/rpc_base/test/CMakeLists.txt +++ b/src/components/rpc_base/test/CMakeLists.txt @@ -46,7 +46,6 @@ set(LIBRARIES set(SOURCES rpc_base_json_test.cc rpc_base_test.cc - main.cc ) if (${HMI_DBUS_API}) diff --git a/src/components/rpc_base/test/main.cc b/src/components/rpc_base/test/main.cc deleted file mode 100644 index 59fa20e8b5..0000000000 --- a/src/components/rpc_base/test/main.cc +++ /dev/null @@ -1,7 +0,0 @@ -#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/src/components/security_manager/test/CMakeLists.txt b/src/components/security_manager/test/CMakeLists.txt index a87267dd77..ec442e3cf9 100644 --- a/src/components/security_manager/test/CMakeLists.txt +++ b/src/components/security_manager/test/CMakeLists.txt @@ -43,7 +43,6 @@ set(SOURCES ${COMPONENTS_DIR}/security_manager/test/security_manager_test.cc ${COMPONENTS_DIR}/security_manager/test/security_query_test.cc ${COMPONENTS_DIR}/security_manager/test/security_query_matcher.cc - ${COMPONENTS_DIR}/security_manager/test/main.cc ) set(LIBRARIES diff --git a/src/components/security_manager/test/main.cc b/src/components/security_manager/test/main.cc deleted file mode 100644 index ed4c5e32b3..0000000000 --- a/src/components/security_manager/test/main.cc +++ /dev/null @@ -1,39 +0,0 @@ -/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/src/components/smart_objects/test/CMakeLists.txt b/src/components/smart_objects/test/CMakeLists.txt index fbcd78cdc1..0f47b1c479 100644 --- a/src/components/smart_objects/test/CMakeLists.txt +++ b/src/components/smart_objects/test/CMakeLists.txt @@ -53,7 +53,6 @@ set(SOURCES ${COMPONENTS_DIR}/smart_objects/test/TSharedPtr_test.cc ${COMPONENTS_DIR}/smart_objects/test/smart_object_performance_test.cc ${COMPONENTS_DIR}/smart_objects/test/map_performance_test.cc - ${COMPONENTS_DIR}/smart_objects/test/main.cc ${COMPONENTS_DIR}/smart_objects/test/BoolSchemaItem_test.cc ${COMPONENTS_DIR}/smart_objects/test/NumberSchemaItem_test.cc ${COMPONENTS_DIR}/smart_objects/test/StringSchemaItem_test.cc diff --git a/src/components/smart_objects/test/main.cc b/src/components/smart_objects/test/main.cc deleted file mode 100644 index 59fa20e8b5..0000000000 --- a/src/components/smart_objects/test/main.cc +++ /dev/null @@ -1,7 +0,0 @@ -#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/src/components/test_main.cc b/src/components/test_main.cc new file mode 100755 index 0000000000..a0aee7614d --- /dev/null +++ b/src/components/test_main.cc @@ -0,0 +1,10 @@ +#include "gmock/gmock.h"
+#include "utils/logger.h"
+
+int main(int argc, char** argv) {
+ testing::InitGoogleMock(&argc, argv);
+ const int result = RUN_ALL_TESTS();
+ DEINIT_LOGGER();
+ return result;
+}
+
diff --git a/src/components/transport_manager/test/CMakeLists.txt b/src/components/transport_manager/test/CMakeLists.txt index 630b85b8a6..226bfa1885 100644 --- a/src/components/transport_manager/test/CMakeLists.txt +++ b/src/components/transport_manager/test/CMakeLists.txt @@ -67,7 +67,6 @@ endif() set(SOURCES - ${COMPONENTS_DIR}/transport_manager/test/main.cc ${COMPONENTS_DIR}/transport_manager/test/mock_application.cc ${COMPONENTS_DIR}/transport_manager/test/transport_manager_test.cc ${COMPONENTS_DIR}/transport_manager/test/mock_connection_factory.cc diff --git a/src/components/transport_manager/test/main.cc b/src/components/transport_manager/test/main.cc deleted file mode 100644 index bc4c36c55a..0000000000 --- a/src/components/transport_manager/test/main.cc +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2014, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#include "gmock/gmock.h" - -int main(int argc, char** argv) { - testing::InitGoogleMock(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/src/components/utils/test/CMakeLists.txt b/src/components/utils/test/CMakeLists.txt index 377b7dba7b..c0fe389044 100644 --- a/src/components/utils/test/CMakeLists.txt +++ b/src/components/utils/test/CMakeLists.txt @@ -37,7 +37,6 @@ include_directories ( ) set(testSources - main.cc messagemeter_test.cc file_system_test.cc date_time_test.cc diff --git a/src/components/utils/test/main.cc b/src/components/utils/test/main.cc deleted file mode 100644 index 59fa20e8b5..0000000000 --- a/src/components/utils/test/main.cc +++ /dev/null @@ -1,7 +0,0 @@ -#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
|