diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a7c86a43d..e8871c2757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,12 @@ See [Eclipse iceoryx 1.0.0 (Almond)](https://projects.eclipse.org/projects/techn - iceoryx libs should be build as static libs [\#509](https://github.com/eclipse-iceoryx/iceoryx/issues/509) - Build with gcov is broken [\#497](https://github.com/eclipse-iceoryx/iceoryx/issues/497) +## [v0.99.x](https://github.com/eclipse-iceoryx/iceoryx/tree/v0.99.x) (2021-04-xx) + +[Full Changelog](https://github.com/eclipse-iceoryx/iceoryx/compare/v0.99.6...v0.99.x) + +- cleanup testing libraries; if used outside of iceoryx, include paths and link targets must be adjusted + ## [v0.99.6](https://github.com/eclipse-iceoryx/iceoryx/tree/v0.99.6) (2021-04-08) [Full Changelog](https://github.com/eclipse-iceoryx/iceoryx/compare/v0.99.5...v0.99.6) diff --git a/iceoryx_binding_c/test/CMakeLists.txt b/iceoryx_binding_c/test/CMakeLists.txt index cd1b78d581..f1e08e4179 100644 --- a/iceoryx_binding_c/test/CMakeLists.txt +++ b/iceoryx_binding_c/test/CMakeLists.txt @@ -18,6 +18,7 @@ cmake_minimum_required(VERSION 3.5) project(test_binding_c VERSION 0) find_package(iceoryx_utils_testing REQUIRED) +find_package(iceoryx_posh_testing REQUIRED) find_package(GTest CONFIG REQUIRED) set(PROJECT_PREFIX "binding_c") @@ -35,7 +36,7 @@ set(TEST_LINK_LIBS iceoryx_posh::iceoryx_posh iceoryx_posh::iceoryx_posh_config iceoryx_posh::iceoryx_posh_roudi - iceoryx_posh::iceoryx_posh_roudi_environment + iceoryx_posh_testing::iceoryx_posh_testing ) if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") diff --git a/iceoryx_binding_c/test/moduletests/test_chunk.cpp b/iceoryx_binding_c/test/moduletests/test_chunk.cpp index 834685e921..3895d4280a 100644 --- a/iceoryx_binding_c/test/moduletests/test_chunk.cpp +++ b/iceoryx_binding_c/test/moduletests/test_chunk.cpp @@ -20,7 +20,7 @@ extern "C" { #include "iceoryx_binding_c/runtime.h" } -#include "testutils/roudi_gtest.hpp" +#include "iceoryx_posh/testing/roudi_gtest.hpp" namespace { diff --git a/iceoryx_binding_c/test/moduletests/test_listener.cpp b/iceoryx_binding_c/test/moduletests/test_listener.cpp index aa7d4de687..37a33bb127 100644 --- a/iceoryx_binding_c/test/moduletests/test_listener.cpp +++ b/iceoryx_binding_c/test/moduletests/test_listener.cpp @@ -21,7 +21,7 @@ #include "iceoryx_posh/mepoo/mepoo_config.hpp" #include "iceoryx_posh/popo/listener.hpp" #include "iceoryx_posh/popo/user_trigger.hpp" -#include "testutils/timing_test.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" using namespace iox; using namespace iox::popo; diff --git a/iceoryx_binding_c/test/moduletests/test_node.cpp b/iceoryx_binding_c/test/moduletests/test_node.cpp index 69f31fca27..a3edcac54e 100644 --- a/iceoryx_binding_c/test/moduletests/test_node.cpp +++ b/iceoryx_binding_c/test/moduletests/test_node.cpp @@ -16,7 +16,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_posh/runtime/posh_runtime.hpp" -#include "testutils/roudi_gtest.hpp" +#include "iceoryx_posh/testing/roudi_gtest.hpp" using namespace iox; using namespace iox::runtime; diff --git a/iceoryx_binding_c/test/moduletests/test_publisher.cpp b/iceoryx_binding_c/test/moduletests/test_publisher.cpp index ee82c64186..40c2b404c5 100644 --- a/iceoryx_binding_c/test/moduletests/test_publisher.cpp +++ b/iceoryx_binding_c/test/moduletests/test_publisher.cpp @@ -20,8 +20,8 @@ #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.hpp" #include "iceoryx_posh/internal/popo/ports/publisher_port_roudi.hpp" #include "iceoryx_posh/internal/popo/ports/publisher_port_user.hpp" -#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" +#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp" using namespace iox; using namespace iox::popo; diff --git a/iceoryx_binding_c/test/moduletests/test_runtime.cpp b/iceoryx_binding_c/test/moduletests/test_runtime.cpp index 24777162b9..9d62016372 100644 --- a/iceoryx_binding_c/test/moduletests/test_runtime.cpp +++ b/iceoryx_binding_c/test/moduletests/test_runtime.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020 by Apex.AI Inc. All rights reserved. +// Copyright (c) 2020 - 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ extern "C" { } #include "iceoryx_posh/iceoryx_posh_types.hpp" -#include "testutils/roudi_gtest.hpp" +#include "iceoryx_posh/testing/roudi_gtest.hpp" using namespace iox; using namespace iox::runtime; diff --git a/iceoryx_binding_c/test/moduletests/test_subscriber.cpp b/iceoryx_binding_c/test/moduletests/test_subscriber.cpp index 58c70afe9c..2f88c23c33 100644 --- a/iceoryx_binding_c/test/moduletests/test_subscriber.cpp +++ b/iceoryx_binding_c/test/moduletests/test_subscriber.cpp @@ -22,8 +22,8 @@ #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.hpp" #include "iceoryx_posh/internal/popo/ports/subscriber_port_single_producer.hpp" #include "iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp" -#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" +#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp" #include "mocks/wait_set_mock.hpp" using namespace iox; diff --git a/iceoryx_binding_c/test/moduletests/test_wait_set.cpp b/iceoryx_binding_c/test/moduletests/test_wait_set.cpp index 4364c6a457..74e07c098a 100644 --- a/iceoryx_binding_c/test/moduletests/test_wait_set.cpp +++ b/iceoryx_binding_c/test/moduletests/test_wait_set.cpp @@ -19,8 +19,8 @@ #include "iceoryx_binding_c/internal/cpp2c_subscriber.hpp" #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" #include "mocks/wait_set_mock.hpp" -#include "testutils/timing_test.hpp" using namespace iox; using namespace iox::popo; diff --git a/iceoryx_dds/test/CMakeLists.txt b/iceoryx_dds/test/CMakeLists.txt index 74c9e1f489..19702a6f22 100644 --- a/iceoryx_dds/test/CMakeLists.txt +++ b/iceoryx_dds/test/CMakeLists.txt @@ -18,6 +18,7 @@ cmake_minimum_required(VERSION 3.5) project(test_iox_to_dds VERSION 0) find_package(iceoryx_utils_testing REQUIRED) +find_package(iceoryx_posh_testing REQUIRED) find_package(GTest CONFIG REQUIRED) set(PROJECT_PREFIX "dds_gateway") @@ -32,6 +33,7 @@ set(TEST_LINK_LIBS iceoryx_utils::iceoryx_utils iceoryx_utils_testing::iceoryx_utils_testing iceoryx_posh::iceoryx_posh + iceoryx_posh_testing::iceoryx_posh_testing iceoryx_dds::iceoryx_dds ) diff --git a/iceoryx_dds/test/helpers/fixture_dds_gateway.hpp b/iceoryx_dds/test/helpers/fixture_dds_gateway.hpp index 5a4b9f29ab..9e794468d9 100644 --- a/iceoryx_dds/test/helpers/fixture_dds_gateway.hpp +++ b/iceoryx_dds/test/helpers/fixture_dds_gateway.hpp @@ -1,4 +1,5 @@ -// Copyright (c) 2020 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved. +// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +22,6 @@ #include "mocks/google_mocks.hpp" #include "test.hpp" -#include "testutils/roudi_gtest.hpp" template class DDSGatewayTestFixture : public Test diff --git a/iceoryx_dds/test/mocks/chunk_mock_dds.hpp b/iceoryx_dds/test/mocks/chunk_mock_dds.hpp deleted file mode 100644 index 538b36accf..0000000000 --- a/iceoryx_dds/test/mocks/chunk_mock_dds.hpp +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: Apache-2.0 - -#ifndef IOX_DDS_GATEWAY_MOCKS_CHUNK_MOCK_HPP -#define IOX_DDS_GATEWAY_MOCKS_CHUNK_MOCK_HPP - -#include "iceoryx_posh/mepoo/chunk_header.hpp" -#include "iceoryx_utils/cxx/helplets.hpp" - -#include -#include - -#if defined(QNX) || defined(QNX__) || defined(__QNX__) -#include -#endif - -/// -/// This mock is an adapted copy from iceoryx_posh. -/// Shared mocks across modules should be exported to a library for usage across all modules to avoid copying. -/// When this is done, this (and all other) copies should be deleted, and mocks from the shaared library should be used. -/// -template -class ChunkMockDDS -{ - public: - ChunkMockDDS(T val) - { -#if defined(QNX) || defined(QNX__) || defined(__QNX__) - m_rawMemory = static_cast(memalign(Alignment, Size)); -#elif defined(_WIN32) - m_rawMemory = static_cast(_aligned_malloc(Alignment, Size)); -#else - m_rawMemory = static_cast(aligned_alloc(Alignment, Size)); -#endif - assert(m_rawMemory != nullptr && "Could not get aligned memory"); - - memset(m_rawMemory, 0xFF, Size); - - auto chunkSettingsResult = iox::mepoo::ChunkSettings::create(sizeof(T), alignof(T)); - iox::cxx::Ensures(!chunkSettingsResult.has_error() && "Invalid parameter for ChunkMock"); - auto& chunkSettings = chunkSettingsResult.value(); - - m_chunkHeader = new (m_rawMemory) iox::mepoo::ChunkHeader(Size, chunkSettings); - - // Set the value - auto userPayloadPtr = reinterpret_cast(m_rawMemory + sizeof(iox::mepoo::ChunkHeader)); - *userPayloadPtr = val; - - m_value = static_cast(m_chunkHeader->userPayload()); - } - - ~ChunkMockDDS() - { - if (m_chunkHeader != nullptr) - { - m_chunkHeader->~ChunkHeader(); - } - if (m_rawMemory != nullptr) - { - free(m_rawMemory); - m_rawMemory = nullptr; - } - } - - iox::mepoo::ChunkHeader* chunkHeader() - { - return m_chunkHeader; - } - - T* sample() - { - return m_value; - } - - ChunkMockDDS(const ChunkMockDDS&) = delete; - ChunkMockDDS(ChunkMockDDS&&) = delete; - ChunkMockDDS& operator=(const ChunkMockDDS&) = delete; - ChunkMockDDS& operator=(ChunkMockDDS&&) = delete; - - private: - static constexpr size_t Size = sizeof(iox::mepoo::ChunkHeader) + sizeof(T); - static constexpr size_t Alignment = iox::cxx::maxAlignment(); - uint8_t* m_rawMemory{nullptr}; - iox::mepoo::ChunkHeader* m_chunkHeader = nullptr; - T* m_value = nullptr; -}; - -#endif // IOX_DDS_GATEWAY_MOCKS_CHUNK_MOCK_HPP diff --git a/iceoryx_dds/test/moduletests/test_dds_to_iox.cpp b/iceoryx_dds/test/moduletests/test_dds_to_iox.cpp index 18d94944ec..4a8c163d6d 100644 --- a/iceoryx_dds/test/moduletests/test_dds_to_iox.cpp +++ b/iceoryx_dds/test/moduletests/test_dds_to_iox.cpp @@ -1,4 +1,5 @@ -// Copyright (c) 2020 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved. +// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2020 - 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,10 +20,8 @@ #include "iceoryx_dds/gateway/dds_to_iox.hpp" #include "iceoryx_posh/gateway/channel.hpp" -#include "mocks/chunk_mock_dds.hpp" #include "mocks/google_mocks.hpp" #include "test.hpp" -#include "testutils/roudi_gtest.hpp" using namespace ::testing; using ::testing::_; diff --git a/iceoryx_dds/test/moduletests/test_iox_to_dds.cpp b/iceoryx_dds/test/moduletests/test_iox_to_dds.cpp index 9960202fe4..b10b9b20e6 100644 --- a/iceoryx_dds/test/moduletests/test_iox_to_dds.cpp +++ b/iceoryx_dds/test/moduletests/test_iox_to_dds.cpp @@ -1,4 +1,5 @@ -// Copyright (c) 2020 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved. +// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2020 - 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,10 +26,9 @@ #include "iceoryx_utils/cxx/expected.hpp" #include "iceoryx_utils/cxx/optional.hpp" -#include "mocks/chunk_mock_dds.hpp" +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "mocks/google_mocks.hpp" #include "test.hpp" -#include "testutils/roudi_gtest.hpp" #include @@ -194,7 +194,7 @@ TEST_F(Iceoryx2DDSGatewayTest, ForwardsChunkFromSubscriberToDataWriter) auto testService = iox::capro::ServiceDescription({"Radar", "Front-Right", "Reflections"}); // Prepare a mock mempool chunk - ChunkMockDDS mockChunk{42}; + ChunkMock mockChunk{42}; // Set up subscriber to provide the chunk auto mockSubscriber = createMockIceoryxTerminal(testService, iox::popo::SubscriberOptions()); @@ -222,7 +222,7 @@ TEST_F(Iceoryx2DDSGatewayTest, IgnoresMemoryChunksWithNoPayload) auto testService = iox::capro::ServiceDescription({"Radar", "Front-Right", "Reflections"}); // Prepare a mock mempool chunk - ChunkMockDDS mockChunk{0}; + ChunkMock mockChunk{0}; mockChunk.chunkHeader()->m_info.m_payloadSize = 0; // Set up subscriber to provide the chunk @@ -249,7 +249,7 @@ TEST_F(Iceoryx2DDSGatewayTest, ReleasesReferenceToMemoryChunkAfterSend) auto testService = iox::capro::ServiceDescription({"Radar", "Front-Right", "Reflections"}); // Prepare a mock mempool chunk - ChunkMockDDS mockChunk{42}; + ChunkMock mockChunk{42}; // Set up expect sequence of interactions with subscriber and data writer auto mockSubscriber = createMockIceoryxTerminal(testService, iox::popo::SubscriberOptions()); diff --git a/iceoryx_posh/CMakeLists.txt b/iceoryx_posh/CMakeLists.txt index 3244ea272a..1a7154a264 100644 --- a/iceoryx_posh/CMakeLists.txt +++ b/iceoryx_posh/CMakeLists.txt @@ -371,54 +371,76 @@ if(TOML_CONFIG) endif() +# +########## exporting library ########## +# +if(TOML_CONFIG) + set(ROUDI_EXPORT iceoryx_posh_config iox-roudi) +endif() + +setup_install_directories_and_export_package( + TARGETS iceoryx_posh iceoryx_posh_roudi iceoryx_posh_gateway ${ROUDI_EXPORT} + INCLUDE_DIRECTORY include/ +) + +install( + FILES ${CMAKE_BINARY_DIR}/generated/iceoryx/include/${PROJECT_NAME}/iceoryx_posh_deployment.hpp + DESTINATION include/${PREFIX}/${PROJECT_NAME}/ + COMPONENT dev +) + if(ROUDI_ENVIRONMENT OR BUILD_TEST) # ######### posh roudi environment ########## # - add_library(iceoryx_posh_roudi_environment - source/roudi_environment/runtime_test_interface.cpp - source/roudi_environment/roudi_environment.cpp + setup_package_name_and_create_files( + NAME ${PROJECT_NAME}_roudi_environment + NAMESPACE iceoryx_posh_testing + PROJECT_PREFIX ${PREFIX} + ) + + add_library(iceoryx_posh_testing + STATIC + testing/roudi_environment/runtime_test_interface.cpp + testing/roudi_environment/roudi_environment.cpp ) - add_library(${PROJECT_NAMESPACE}::iceoryx_posh_roudi_environment ALIAS iceoryx_posh_roudi_environment) - set_target_properties(iceoryx_posh_roudi_environment PROPERTIES + add_library(iceoryx_posh_testing::iceoryx_posh_testing ALIAS iceoryx_posh_testing) + set_target_properties(iceoryx_posh_testing PROPERTIES CXX_STANDARD_REQUIRED ON CXX_STANDARD ${ICEORYX_CXX_STANDARD} POSITION_INDEPENDENT_CODE ON ) - target_include_directories(iceoryx_posh_roudi_environment PUBLIC - source/roudi_environment + target_include_directories(iceoryx_posh_testing + PUBLIC + $ + $ ) - target_link_libraries(iceoryx_posh_roudi_environment - PUBLIC - ${PROJECT_NAMESPACE}::iceoryx_posh + target_link_libraries(iceoryx_posh_testing PRIVATE + iceoryx_posh::iceoryx_posh iceoryx_utils::iceoryx_utils - ${PROJECT_NAMESPACE}::iceoryx_posh_roudi + iceoryx_posh::iceoryx_posh_roudi ) - target_compile_options(iceoryx_posh_roudi_environment PRIVATE ${ICEORYX_WARNINGS}) -endif() + target_compile_options(iceoryx_posh_testing PRIVATE ${ICEORYX_WARNINGS}) -# -########## exporting library ########## -# -if(TOML_CONFIG) - set(ROUDI_EXPORT iceoryx_posh_config iox-roudi) -endif() - -setup_install_directories_and_export_package( - TARGETS iceoryx_posh iceoryx_posh_roudi iceoryx_posh_gateway ${ROUDI_EXPORT} - INCLUDE_DIRECTORY include/ -) + setup_install_directories_and_export_package( + TARGETS iceoryx_posh_testing + INCLUDE_DIRECTORY testing/include/ + ) -install( - FILES ${CMAKE_BINARY_DIR}/generated/iceoryx/include/${PROJECT_NAME}/iceoryx_posh_deployment.hpp - DESTINATION include/${PREFIX}/${PROJECT_NAME}/ - COMPONENT dev -) + # + ########## find_package in source tree ########## + # + set(${PROJECT_NAME}_testing_DIR ${CMAKE_CURRENT_LIST_DIR}/cmake + CACHE FILEPATH + "${PROJECT_NAME}_testingConfig.cmake to make find_package(${PROJECT_NAME}_testing) work in source tree!" + FORCE + ) +endif() if(BUILD_TEST) add_subdirectory(test) diff --git a/iceoryx_posh/cmake/iceoryx_posh_testingConfig.cmake b/iceoryx_posh/cmake/iceoryx_posh_testingConfig.cmake new file mode 100644 index 0000000000..f347a114d0 --- /dev/null +++ b/iceoryx_posh/cmake/iceoryx_posh_testingConfig.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +# +########## dummyConfig.cmake to be able to use find_package with the source tree ########## +# + +if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND_PRINTED) + message(STATUS "The package '${CMAKE_FIND_PACKAGE_NAME}' is used in source code version.") + set(${CMAKE_FIND_PACKAGE_NAME}_FOUND_PRINTED true CACHE INTERNAL "") +endif() diff --git a/iceoryx_posh/test/CMakeLists.txt b/iceoryx_posh/test/CMakeLists.txt index 09ec8a44e0..68708afea8 100644 --- a/iceoryx_posh/test/CMakeLists.txt +++ b/iceoryx_posh/test/CMakeLists.txt @@ -20,6 +20,7 @@ set(test_iceoryx_posh_VERSION 0) project(test_iceoryx_posh VERSION ${test_iceoryx_posh_VERSION}) find_package(iceoryx_utils_testing REQUIRED) +find_package(iceoryx_posh_testing REQUIRED) if(BUILD_TEST AND NOT GTest_FOUND) find_package(GTest CONFIG REQUIRED) @@ -36,7 +37,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/moduletests/test_input_path.hpp.in file(GLOB_RECURSE MODULETESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/moduletests/*.cpp") file(GLOB_RECURSE INTEGRATIONTESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/integrationtests/*.cpp") file(GLOB_RECURSE COMPONENTTESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/componenttests/*.cpp") -file(GLOB_RECURSE TESTUTILS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/testutils/*.cpp") file(GLOB_RECURSE MOCKS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/mocks/*.cpp") @@ -53,7 +53,7 @@ set(TEST_LINK_LIBS iceoryx_posh::iceoryx_posh_config iceoryx_posh::iceoryx_posh_gateway iceoryx_posh::iceoryx_posh_roudi - iceoryx_posh::iceoryx_posh_roudi_environment + iceoryx_posh_testing::iceoryx_posh_testing ) if(LINUX) @@ -69,7 +69,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() # unittests -add_executable(${PROJECT_PREFIX}_moduletests ${MODULETESTS_SRC} ${TESTUTILS_SRC} ${MOCKS_SRC}) +add_executable(${PROJECT_PREFIX}_moduletests ${MODULETESTS_SRC} ${MOCKS_SRC}) target_include_directories(${PROJECT_PREFIX}_moduletests PRIVATE . ${CMAKE_BINARY_DIR}/generated) # TODO: fix conversion warnings target_compile_options(${PROJECT_PREFIX}_moduletests PRIVATE ${TEST_CXX_FLAGS}) diff --git a/iceoryx_posh/test/integrationtests/service_discovery/test_roudi_service_discovery.hpp b/iceoryx_posh/test/integrationtests/service_discovery/test_roudi_service_discovery.hpp index 822d23e5e0..742be9f7d4 100644 --- a/iceoryx_posh/test/integrationtests/service_discovery/test_roudi_service_discovery.hpp +++ b/iceoryx_posh/test/integrationtests/service_discovery/test_roudi_service_discovery.hpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +18,7 @@ #ifndef IOX_POSH_SERVICE_DISCOVERY_TEST_ROUDI_SERVICE_DISCOVERY_HPP #define IOX_POSH_SERVICE_DISCOVERY_TEST_ROUDI_SERVICE_DISCOVERY_HPP -#include "testutils/roudi_gtest.hpp" +#include "iceoryx_posh/testing/roudi_gtest.hpp" using iox::capro::IdString_t; using iox::runtime::InstanceContainer; diff --git a/iceoryx_posh/test/integrationtests/test_interface_port_stack_blowup.cpp b/iceoryx_posh/test/integrationtests/test_interface_port_stack_blowup.cpp index 83cab61b85..ff7970dc55 100644 --- a/iceoryx_posh/test/integrationtests/test_interface_port_stack_blowup.cpp +++ b/iceoryx_posh/test/integrationtests/test_interface_port_stack_blowup.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +18,7 @@ #include "iceoryx_posh/gateway/gateway_base.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" -#include "testutils/roudi_gtest.hpp" +#include "iceoryx_posh/testing/roudi_gtest.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp b/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp index 1b30779f49..8bba60e291 100644 --- a/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp +++ b/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp @@ -25,8 +25,8 @@ #include "iceoryx_utils/cxx/generic_raii.hpp" #include "iceoryx_utils/error_handling/error_handling.hpp" #include "iceoryx_utils/internal/concurrent/smart_lock.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" #include "test.hpp" -#include "testutils/timing_test.hpp" #include #include diff --git a/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp b/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp index 8ef7b85dae..fec028194c 100644 --- a/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp +++ b/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp @@ -23,7 +23,7 @@ #include "iceoryx_utils/error_handling/error_handling.hpp" #include "iceoryx_utils/internal/units/duration.hpp" #include "iceoryx_utils/posix_wrapper/timer.hpp" -#include "testutils/timing_test.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" #include #include @@ -33,7 +33,7 @@ #define protected public #include "iceoryx_posh/internal/roudi/roudi.hpp" -#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp" +#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp" #undef private #undef protected diff --git a/iceoryx_posh/test/integrationtests/test_publisher_subscriber_communication.cpp b/iceoryx_posh/test/integrationtests/test_publisher_subscriber_communication.cpp index 3b6ef45c95..45c727a9bb 100644 --- a/iceoryx_posh/test/integrationtests/test_publisher_subscriber_communication.cpp +++ b/iceoryx_posh/test/integrationtests/test_publisher_subscriber_communication.cpp @@ -17,6 +17,7 @@ #include "iceoryx_posh/popo/publisher.hpp" #include "iceoryx_posh/popo/subscriber.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iceoryx_posh/testing/roudi_gtest.hpp" #include "iceoryx_utils/cxx/forward_list.hpp" #include "iceoryx_utils/cxx/list.hpp" #include "iceoryx_utils/cxx/optional.hpp" @@ -25,8 +26,7 @@ #include "iceoryx_utils/cxx/variant.hpp" #include "iceoryx_utils/cxx/vector.hpp" #include "iceoryx_utils/posix_wrapper/semaphore.hpp" -#include "testutils/roudi_gtest.hpp" -#include "testutils/watch_dog.hpp" +#include "iceoryx_utils/testing/watch_dog.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/integrationtests/test_roudi_roudi_environment.cpp b/iceoryx_posh/test/integrationtests/test_roudi_roudi_environment.cpp index 94a4fecfa7..dbcf1dddda 100644 --- a/iceoryx_posh/test/integrationtests/test_roudi_roudi_environment.cpp +++ b/iceoryx_posh/test/integrationtests/test_roudi_roudi_environment.cpp @@ -15,7 +15,7 @@ // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp" +#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_compatibility_check_level.cpp b/iceoryx_posh/test/moduletests/test_compatibility_check_level.cpp index 5b71eb5c58..6724173a23 100644 --- a/iceoryx_posh/test/moduletests/test_compatibility_check_level.cpp +++ b/iceoryx_posh/test/moduletests/test_compatibility_check_level.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +18,7 @@ #include "iceoryx_posh/version/compatibility_check_level.hpp" #include "iceoryx_utils/log/logging.hpp" #include "iceoryx_utils/log/logstream.hpp" -#include "mocks/logger_mock.hpp" +#include "iceoryx_utils/testing/mocks/logger_mock.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp b/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp index cca88fb70a..eea9ed9f77 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp @@ -23,8 +23,8 @@ #include "iceoryx_utils/platform/fcntl.hpp" #include "iceoryx_utils/platform/stat.hpp" #include "iceoryx_utils/platform/types.hpp" +#include "iceoryx_utils/testing/test_definitions.hpp" #include "test.hpp" -#include "testutils/test_definitions.hpp" #include diff --git a/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp b/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp index 35bc9c67a9..1e295837e8 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,8 +23,8 @@ #include "iceoryx_utils/internal/posix_wrapper/shared_memory_object.hpp" #include "iceoryx_utils/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_utils/internal/relocatable_pointer/base_relative_pointer.hpp" +#include "iceoryx_utils/testing/test_definitions.hpp" #include "test.hpp" -#include "testutils/test_definitions.hpp" using namespace ::testing; diff --git a/iceoryx_posh/test/moduletests/test_monitoringmode_logstream.cpp b/iceoryx_posh/test/moduletests/test_monitoringmode_logstream.cpp index 89d2064d13..d666ca3d95 100644 --- a/iceoryx_posh/test/moduletests/test_monitoringmode_logstream.cpp +++ b/iceoryx_posh/test/moduletests/test_monitoringmode_logstream.cpp @@ -17,7 +17,7 @@ #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_utils/log/logging.hpp" #include "iceoryx_utils/log/logstream.hpp" -#include "mocks/logger_mock.hpp" +#include "iceoryx_utils/testing/mocks/logger_mock.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_mq_message.cpp b/iceoryx_posh/test/moduletests/test_mq_message.cpp index eef1c3093b..e9bbbc4e26 100644 --- a/iceoryx_posh/test/moduletests/test_mq_message.cpp +++ b/iceoryx_posh/test/moduletests/test_mq_message.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +17,7 @@ #if !defined(_WIN32) && !defined(__APPLE__) #include "iceoryx_posh/internal/runtime/ipc_message.hpp" -#include "mocks/time_mock.hpp" +#include "iceoryx_utils/testing/mocks/time_mock.hpp" #include "test.hpp" using namespace ::testing; diff --git a/iceoryx_posh/test/moduletests/test_popo_base_subscriber.cpp b/iceoryx_posh/test/moduletests/test_popo_base_subscriber.cpp index 9dd7e9e353..19cbe710e2 100644 --- a/iceoryx_posh/test/moduletests/test_popo_base_subscriber.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_base_subscriber.cpp @@ -23,7 +23,7 @@ #include "iceoryx_utils/cxx/optional.hpp" #include "iceoryx_utils/cxx/unique_ptr.hpp" -#include "mocks/chunk_mock.hpp" +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "mocks/subscriber_mock.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_popo_condition_variable.cpp b/iceoryx_posh/test/moduletests/test_popo_condition_variable.cpp index 9b7a5391cb..ff6f1dc0ee 100644 --- a/iceoryx_posh/test/moduletests/test_popo_condition_variable.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_condition_variable.cpp @@ -18,9 +18,9 @@ #include "iceoryx_posh/internal/popo/building_blocks/condition_listener.hpp" #include "iceoryx_posh/internal/popo/building_blocks/condition_notifier.hpp" #include "iceoryx_posh/internal/popo/building_blocks/condition_variable_data.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" +#include "iceoryx_utils/testing/watch_dog.hpp" #include "test.hpp" -#include "testutils/timing_test.hpp" -#include "testutils/watch_dog.hpp" #include #include diff --git a/iceoryx_posh/test/moduletests/test_popo_listener.cpp b/iceoryx_posh/test/moduletests/test_popo_listener.cpp index 71ee5c413f..36d9c3503c 100644 --- a/iceoryx_posh/test/moduletests/test_popo_listener.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_listener.cpp @@ -23,9 +23,9 @@ #include "iceoryx_utils/cxx/vector.hpp" #include "iceoryx_utils/internal/concurrent/smart_lock.hpp" #include "iceoryx_utils/posix_wrapper/semaphore.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" +#include "iceoryx_utils/testing/watch_dog.hpp" #include "test.hpp" -#include "testutils/timing_test.hpp" -#include "testutils/watch_dog.hpp" #include #include diff --git a/iceoryx_posh/test/moduletests/test_popo_publisher.cpp b/iceoryx_posh/test/moduletests/test_popo_publisher.cpp index cec78ceaad..2447557102 100644 --- a/iceoryx_posh/test/moduletests/test_popo_publisher.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_publisher.cpp @@ -16,7 +16,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_posh/popo/publisher.hpp" -#include "mocks/chunk_mock.hpp" +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "mocks/publisher_mock.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_popo_sample.cpp b/iceoryx_posh/test/moduletests/test_popo_sample.cpp index 98660492db..4d44ac4476 100644 --- a/iceoryx_posh/test/moduletests/test_popo_sample.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_sample.cpp @@ -19,7 +19,7 @@ #include "iceoryx_posh/popo/sample.hpp" #include "iceoryx_utils/cxx/unique_ptr.hpp" -#include "mocks/chunk_mock.hpp" +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_popo_subscriber.cpp b/iceoryx_posh/test/moduletests/test_popo_subscriber.cpp index a008082fde..a9354551ab 100644 --- a/iceoryx_posh/test/moduletests/test_popo_subscriber.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_subscriber.cpp @@ -16,7 +16,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_posh/popo/subscriber.hpp" -#include "mocks/chunk_mock.hpp" +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "mocks/subscriber_mock.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_popo_trigger_handle.cpp b/iceoryx_posh/test/moduletests/test_popo_trigger_handle.cpp index d968dd4302..4dc9889536 100644 --- a/iceoryx_posh/test/moduletests/test_popo_trigger_handle.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_trigger_handle.cpp @@ -17,7 +17,7 @@ #include "iceoryx_posh/internal/popo/building_blocks/condition_listener.hpp" #include "iceoryx_posh/internal/popo/building_blocks/condition_variable_data.hpp" #include "iceoryx_posh/popo/trigger_handle.hpp" -#include "testutils/watch_dog.hpp" +#include "iceoryx_utils/testing/watch_dog.hpp" #include "test.hpp" #include diff --git a/iceoryx_posh/test/moduletests/test_popo_untyped_publisher.cpp b/iceoryx_posh/test/moduletests/test_popo_untyped_publisher.cpp index 9e5ad73ba1..97a19dcb3c 100644 --- a/iceoryx_posh/test/moduletests/test_popo_untyped_publisher.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_untyped_publisher.cpp @@ -16,7 +16,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_posh/popo/untyped_publisher.hpp" -#include "mocks/chunk_mock.hpp" +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "mocks/publisher_mock.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_popo_untyped_subscriber.cpp b/iceoryx_posh/test/moduletests/test_popo_untyped_subscriber.cpp index db9679cd29..68eea5444f 100644 --- a/iceoryx_posh/test/moduletests/test_popo_untyped_subscriber.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_untyped_subscriber.cpp @@ -16,7 +16,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_posh/popo/untyped_subscriber.hpp" -#include "mocks/chunk_mock.hpp" +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "mocks/subscriber_mock.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_popo_waitset.cpp b/iceoryx_posh/test/moduletests/test_popo_waitset.cpp index 0cda920805..090ccf0419 100644 --- a/iceoryx_posh/test/moduletests/test_popo_waitset.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_waitset.cpp @@ -21,9 +21,9 @@ #include "iceoryx_posh/popo/wait_set.hpp" #include "iceoryx_utils/cxx/optional.hpp" #include "iceoryx_utils/cxx/vector.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" +#include "iceoryx_utils/testing/watch_dog.hpp" #include "test.hpp" -#include "testutils/timing_test.hpp" -#include "testutils/watch_dog.hpp" #include #include diff --git a/iceoryx_posh/test/moduletests/test_posh_runtime.cpp b/iceoryx_posh/test/moduletests/test_posh_runtime.cpp index 2c4f1f5b74..f4c8041264 100644 --- a/iceoryx_posh/test/moduletests/test_posh_runtime.cpp +++ b/iceoryx_posh/test/moduletests/test_posh_runtime.cpp @@ -16,10 +16,10 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_posh/iceoryx_posh_types.hpp" -#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" #include "test.hpp" -#include "testutils/timing_test.hpp" #include diff --git a/iceoryx_posh/test/moduletests/test_posh_runtime_node.cpp b/iceoryx_posh/test/moduletests/test_posh_runtime_node.cpp index 70fcbb8aa6..47a28ec186 100644 --- a/iceoryx_posh/test/moduletests/test_posh_runtime_node.cpp +++ b/iceoryx_posh/test/moduletests/test_posh_runtime_node.cpp @@ -15,9 +15,9 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp" #include "iceoryx_posh/runtime/node.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_posh_runtime_single_process.cpp b/iceoryx_posh/test/moduletests/test_posh_runtime_single_process.cpp index 91c376f4d8..519a7f206f 100644 --- a/iceoryx_posh/test/moduletests/test_posh_runtime_single_process.cpp +++ b/iceoryx_posh/test/moduletests/test_posh_runtime_single_process.cpp @@ -15,8 +15,8 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp" #include "iceoryx_posh/runtime/posh_runtime_single_process.hpp" +#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp b/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp index 033f57393b..b9ed3f2f8e 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp @@ -17,7 +17,7 @@ #include "iceoryx_posh/roudi/memory/roudi_memory_manager.hpp" -#include "mocks/logger_mock.hpp" +#include "iceoryx_utils/testing/mocks/logger_mock.hpp" #include "mocks/roudi_memory_block_mock.hpp" #include "mocks/roudi_memory_provider_mock.hpp" diff --git a/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp b/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp index 89a483fac9..1c4bb7ea08 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2019 - 2020 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,11 +15,11 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "mocks/chunk_mock.hpp" +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "mocks/mepoo_memory_manager_mock.hpp" #include "mocks/publisher_mock.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" #include "test.hpp" -#include "testutils/timing_test.hpp" using namespace ::testing; using ::testing::Return; diff --git a/iceoryx_posh/test/moduletests/test_roudi_port_introspection.cpp b/iceoryx_posh/test/moduletests/test_roudi_port_introspection.cpp index d2d0844645..ec0917c19e 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_port_introspection.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_port_introspection.cpp @@ -15,8 +15,8 @@ // // SPDX-License-Identifier: Apache-2.0 +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "iceoryx_utils/cxx/generic_raii.hpp" -#include "mocks/chunk_mock.hpp" #include "mocks/publisher_mock.hpp" #include "mocks/subscriber_mock.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp b/iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp index 5dcb533343..be8218f89d 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp @@ -28,7 +28,7 @@ #include "iceoryx_utils/internal/relocatable_pointer/base_relative_pointer.hpp" #include "iceoryx_utils/posix_wrapper/posix_access_rights.hpp" -#include "testutils/watch_dog.hpp" +#include "iceoryx_utils/testing/watch_dog.hpp" #include #include // std::numeric_limits diff --git a/iceoryx_posh/test/moduletests/test_roudi_process_introspection.cpp b/iceoryx_posh/test/moduletests/test_roudi_process_introspection.cpp index 1b9d1ee875..acc37d2b03 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_process_introspection.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_process_introspection.cpp @@ -15,8 +15,8 @@ // // SPDX-License-Identifier: Apache-2.0 +#include "iceoryx_utils/testing/timing_test.hpp" #include "test.hpp" -#include "testutils/timing_test.hpp" using namespace ::testing; using ::testing::Return; @@ -24,7 +24,7 @@ using ::testing::Return; #include "iceoryx_posh/internal/roudi/introspection/process_introspection.hpp" #include "iceoryx_posh/internal/popo/ports/publisher_port_data.hpp" -#include "mocks/chunk_mock.hpp" +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "mocks/publisher_mock.hpp" class ProcessIntrospectionAccess : public iox::roudi::ProcessIntrospection diff --git a/iceoryx_posh/test/mocks/chunk_mock.hpp b/iceoryx_posh/testing/include/iceoryx_posh/testing/mocks/chunk_mock.hpp similarity index 100% rename from iceoryx_posh/test/mocks/chunk_mock.hpp rename to iceoryx_posh/testing/include/iceoryx_posh/testing/mocks/chunk_mock.hpp diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi_environment/roudi_environment.hpp b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_environment/roudi_environment.hpp similarity index 95% rename from iceoryx_posh/include/iceoryx_posh/internal/roudi_environment/roudi_environment.hpp rename to iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_environment/roudi_environment.hpp index 9851abc0a6..739cdfe242 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi_environment/roudi_environment.hpp +++ b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_environment/roudi_environment.hpp @@ -20,10 +20,9 @@ #include "iceoryx_posh/iceoryx_posh_config.hpp" #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_posh/internal/roudi/roudi.hpp" -#include "iceoryx_posh/internal/roudi_environment/runtime_test_interface.hpp" #include "iceoryx_posh/roudi/iceoryx_roudi_components.hpp" #include "iceoryx_posh/roudi/memory/iceoryx_roudi_memory_manager.hpp" -#include "iceoryx_posh/roudi/roudi_app.hpp" +#include "iceoryx_posh/testing/roudi_environment/runtime_test_interface.hpp" #include #include diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi_environment/runtime_test_interface.hpp b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_environment/runtime_test_interface.hpp similarity index 100% rename from iceoryx_posh/include/iceoryx_posh/internal/roudi_environment/runtime_test_interface.hpp rename to iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_environment/runtime_test_interface.hpp diff --git a/iceoryx_utils/testutils/roudi_gtest.hpp b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp similarity index 89% rename from iceoryx_utils/testutils/roudi_gtest.hpp rename to iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp index ff6e33d479..87562a2297 100644 --- a/iceoryx_utils/testutils/roudi_gtest.hpp +++ b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +17,7 @@ #ifndef IOX_UTILS_TESTUTILS_ROUDI_GTEST_HPP #define IOX_UTILS_TESTUTILS_ROUDI_GTEST_HPP -#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp" +#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp" #include #include diff --git a/iceoryx_posh/source/roudi_environment/roudi_environment.cpp b/iceoryx_posh/testing/roudi_environment/roudi_environment.cpp similarity index 97% rename from iceoryx_posh/source/roudi_environment/roudi_environment.cpp rename to iceoryx_posh/testing/roudi_environment/roudi_environment.cpp index aa0b403332..217ff31216 100644 --- a/iceoryx_posh/source/roudi_environment/roudi_environment.cpp +++ b/iceoryx_posh/testing/roudi_environment/roudi_environment.cpp @@ -15,10 +15,10 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp" #include "iceoryx_posh/internal/popo/building_blocks/typed_unique_id.hpp" #include "iceoryx_posh/internal/roudi/roudi.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp" #include "iceoryx_utils/cxx/helplets.hpp" #include "iceoryx_utils/internal/posix_wrapper/shared_memory_object/memory_map.hpp" #include "iceoryx_utils/log/logmanager.hpp" diff --git a/iceoryx_posh/source/roudi_environment/runtime_test_interface.cpp b/iceoryx_posh/testing/roudi_environment/runtime_test_interface.cpp similarity index 98% rename from iceoryx_posh/source/roudi_environment/runtime_test_interface.cpp rename to iceoryx_posh/testing/roudi_environment/runtime_test_interface.cpp index fcfb4643f9..6b709bca77 100644 --- a/iceoryx_posh/source/roudi_environment/runtime_test_interface.cpp +++ b/iceoryx_posh/testing/roudi_environment/runtime_test_interface.cpp @@ -15,7 +15,7 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_posh/internal/roudi_environment/runtime_test_interface.hpp" +#include "iceoryx_posh/testing/roudi_environment/runtime_test_interface.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" #include "iceoryx_utils/cxx/helplets.hpp" diff --git a/iceoryx_utils/CMakeLists.txt b/iceoryx_utils/CMakeLists.txt index dd86552e8c..fced4081e0 100644 --- a/iceoryx_utils/CMakeLists.txt +++ b/iceoryx_utils/CMakeLists.txt @@ -65,14 +65,14 @@ if(GTest_FOUND) # only GTest_FOUND, just in case someone want's to use iceoryx_u setup_package_name_and_create_files( NAME ${PROJECT_NAME}_testing NAMESPACE iceoryx_utils_testing - PROJECT_PREFIX testutils + PROJECT_PREFIX ${PREFIX} ) add_library(iceoryx_utils_testing STATIC - testutils/mocks/time_mock.cpp - testutils/timing_test.cpp - testutils/compile_test.cpp + testing/mocks/time_mock.cpp + testing/timing_test.cpp + testing/compile_test.cpp ) add_library(iceoryx_utils_testing::iceoryx_utils_testing ALIAS iceoryx_utils_testing) @@ -95,9 +95,7 @@ if(GTest_FOUND) # only GTest_FOUND, just in case someone want's to use iceoryx_u target_include_directories(iceoryx_utils_testing PUBLIC - $ - $ - $ + $ $ ) @@ -116,8 +114,8 @@ if(GTest_FOUND) # only GTest_FOUND, just in case someone want's to use iceoryx_u endif() setup_install_directories_and_export_package( - TARGETS iceoryx_utils_testing - INCLUDE_DIRECTORY testutils/ + TARGETS iceoryx_utils_testing + INCLUDE_DIRECTORY testing/include/ ) # diff --git a/iceoryx_utils/test/CMakeLists.txt b/iceoryx_utils/test/CMakeLists.txt index 211be38f10..450f6ef387 100644 --- a/iceoryx_utils/test/CMakeLists.txt +++ b/iceoryx_utils/test/CMakeLists.txt @@ -20,13 +20,13 @@ set(test_iceoryx_utils_VERSION 0) project(test_iceoryx_utils VERSION ${test_iceoryx_utils_VERSION}) find_package(Threads REQUIRED) +find_package(iceoryx_utils_testing REQUIRED) set(PROJECT_PREFIX "utils") file(GLOB_RECURSE MODULETESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/moduletests/*.cpp") file(GLOB_RECURSE INTEGRATIONTESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/integrationtests/*.cpp") file(GLOB_RECURSE COMPONENTTESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/componenttests/*.cpp") -file(GLOB_RECURSE TESTUTILS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/testutils/*.cpp") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PROJECT_PREFIX}/test) @@ -53,7 +53,7 @@ endif() # set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_BINARY_DIR}/test) # unittests -add_executable(${PROJECT_PREFIX}_moduletests ${MODULETESTS_SRC} ${TESTUTILS_SRC}) +add_executable(${PROJECT_PREFIX}_moduletests ${MODULETESTS_SRC}) target_include_directories(${PROJECT_PREFIX}_moduletests PRIVATE .) # TODO: fix conversion warnings target_compile_options(${PROJECT_PREFIX}_moduletests PRIVATE ${TEST_CXX_FLAGS}) @@ -65,7 +65,7 @@ set_target_properties(${PROJECT_PREFIX}_moduletests PROPERTIES ) # integration tests -add_executable( ${PROJECT_PREFIX}_integrationtests ${INTEGRATIONTESTS_SRC} ${TESTUTILS_SRC}) +add_executable( ${PROJECT_PREFIX}_integrationtests ${INTEGRATIONTESTS_SRC}) target_compile_options(${PROJECT_PREFIX}_integrationtests PRIVATE ${TEST_CXX_FLAGS}) target_include_directories(${PROJECT_PREFIX}_integrationtests PRIVATE .) target_link_libraries(${PROJECT_PREFIX}_integrationtests ${TEST_LINK_LIBS}) diff --git a/iceoryx_utils/test/moduletests/test_concurrent_periodic_task.cpp b/iceoryx_utils/test/moduletests/test_concurrent_periodic_task.cpp index 17412ce795..01c3580551 100644 --- a/iceoryx_utils/test/moduletests/test_concurrent_periodic_task.cpp +++ b/iceoryx_utils/test/moduletests/test_concurrent_periodic_task.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020 by Apex.AI Inc. All rights reserved. +// Copyright (c) 2020 - 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #include "iceoryx_utils/cxx/function_ref.hpp" #include "iceoryx_utils/cxx/method_callback.hpp" #include "iceoryx_utils/internal/concurrent/periodic_task.hpp" -#include "timing_test.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" #include "test.hpp" diff --git a/iceoryx_utils/test/moduletests/test_concurrent_trigger_queue.cpp b/iceoryx_utils/test/moduletests/test_concurrent_trigger_queue.cpp index 10baf6cb0d..eeea2f30f6 100644 --- a/iceoryx_utils/test/moduletests/test_concurrent_trigger_queue.cpp +++ b/iceoryx_utils/test/moduletests/test_concurrent_trigger_queue.cpp @@ -19,8 +19,8 @@ #include "iceoryx_utils/concurrent/resizeable_lockfree_queue.hpp" #include "iceoryx_utils/internal/concurrent/fifo.hpp" #include "iceoryx_utils/internal/concurrent/trigger_queue.hpp" +#include "iceoryx_utils/testing/watch_dog.hpp" #include "test.hpp" -#include "testutils/watch_dog.hpp" namespace { diff --git a/iceoryx_utils/test/moduletests/test_cxx_deadline_timer.cpp b/iceoryx_utils/test/moduletests/test_cxx_deadline_timer.cpp index 808318664c..cd2ce0c924 100644 --- a/iceoryx_utils/test/moduletests/test_cxx_deadline_timer.cpp +++ b/iceoryx_utils/test/moduletests/test_cxx_deadline_timer.cpp @@ -17,8 +17,8 @@ #include "iceoryx_utils/cxx/deadline_timer.hpp" #include "iceoryx_utils/internal/units/duration.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" #include "test.hpp" -#include "testutils/timing_test.hpp" #include #include diff --git a/iceoryx_utils/test/moduletests/test_cxx_newtype.cpp b/iceoryx_utils/test/moduletests/test_cxx_newtype.cpp index 73c34cc119..e723cbe979 100644 --- a/iceoryx_utils/test/moduletests/test_cxx_newtype.cpp +++ b/iceoryx_utils/test/moduletests/test_cxx_newtype.cpp @@ -16,8 +16,8 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_utils/cxx/newtype.hpp" +#include "iceoryx_utils/testing/compile_test.hpp" #include "test.hpp" -#include "testutils/compile_test.hpp" namespace { diff --git a/iceoryx_utils/test/moduletests/test_logstream.cpp b/iceoryx_utils/test/moduletests/test_logstream.cpp index 946c52cb09..e528c261d2 100644 --- a/iceoryx_utils/test/moduletests/test_logstream.cpp +++ b/iceoryx_utils/test/moduletests/test_logstream.cpp @@ -17,8 +17,8 @@ #include "iceoryx_utils/log/logging.hpp" #include "iceoryx_utils/log/logstream.hpp" -#include "mocks/logger_mock.hpp" -#include "test.hpp" +#include "iceoryx_utils/testing/mocks/logger_mock.hpp" +#include "iceoryx_utils/testing/test.hpp" #include #include diff --git a/iceoryx_utils/test/moduletests/test_posix_mutex.cpp b/iceoryx_utils/test/moduletests/test_posix_mutex.cpp index 7458d61c96..55d90f01b6 100644 --- a/iceoryx_utils/test/moduletests/test_posix_mutex.cpp +++ b/iceoryx_utils/test/moduletests/test_posix_mutex.cpp @@ -17,8 +17,8 @@ #include "iceoryx_utils/cxx/deadline_timer.hpp" #include "iceoryx_utils/internal/posix_wrapper/mutex.hpp" -#include "test.hpp" -#include "testutils/watch_dog.hpp" +#include "iceoryx_utils/testing/test.hpp" +#include "iceoryx_utils/testing/watch_dog.hpp" #include #include diff --git a/iceoryx_utils/test/moduletests/test_posix_timer.cpp b/iceoryx_utils/test/moduletests/test_posix_timer.cpp index c57c4f3578..5d6f5e784c 100644 --- a/iceoryx_utils/test/moduletests/test_posix_timer.cpp +++ b/iceoryx_utils/test/moduletests/test_posix_timer.cpp @@ -19,8 +19,8 @@ #include "iceoryx_utils/error_handling/error_handling.hpp" #include "iceoryx_utils/internal/units/duration.hpp" #include "iceoryx_utils/posix_wrapper/timer.hpp" -#include "test.hpp" -#include "testutils/timing_test.hpp" +#include "iceoryx_utils/testing/test.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" #include #include diff --git a/iceoryx_utils/test/moduletests/test_semaphore_module.cpp b/iceoryx_utils/test/moduletests/test_semaphore_module.cpp index 8aab54bbec..da5c563562 100644 --- a/iceoryx_utils/test/moduletests/test_semaphore_module.cpp +++ b/iceoryx_utils/test/moduletests/test_semaphore_module.cpp @@ -15,13 +15,13 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "timing_test.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" #if !(defined(QNX) || defined(QNX__) || defined(__QNX__)) #include "iceoryx_utils/internal/units/duration.hpp" #include "iceoryx_utils/platform/time.hpp" #include "iceoryx_utils/posix_wrapper/semaphore.hpp" -#include "test.hpp" +#include "iceoryx_utils/testing/test.hpp" #include #include diff --git a/iceoryx_utils/test/stresstests/test_stress_sofi.cpp b/iceoryx_utils/test/stresstests/test_stress_sofi.cpp index 0601ff21f7..0f34ed7cd6 100644 --- a/iceoryx_utils/test/stresstests/test_stress_sofi.cpp +++ b/iceoryx_utils/test/stresstests/test_stress_sofi.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +17,7 @@ #include "iceoryx_utils/internal/concurrent/sofi.hpp" -#include "test.hpp" +#include "iceoryx_utils/testing/test.hpp" #include #include diff --git a/iceoryx_utils/testutils/compile_test.cpp b/iceoryx_utils/testing/compile_test.cpp similarity index 92% rename from iceoryx_utils/testutils/compile_test.cpp rename to iceoryx_utils/testing/compile_test.cpp index 778caf8d12..cb78577c13 100644 --- a/iceoryx_utils/testutils/compile_test.cpp +++ b/iceoryx_utils/testing/compile_test.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,7 +15,7 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "compile_test.hpp" +#include "iceoryx_utils/testing/compile_test.hpp" CompileTest::CompileTest(const std::string& codePrefix, const std::vector& includePath) noexcept : m_codePrefix(codePrefix) diff --git a/iceoryx_utils/testutils/compile_test.hpp b/iceoryx_utils/testing/include/iceoryx_utils/testing/compile_test.hpp similarity index 100% rename from iceoryx_utils/testutils/compile_test.hpp rename to iceoryx_utils/testing/include/iceoryx_utils/testing/compile_test.hpp diff --git a/iceoryx_utils/testutils/mocks/logger_mock.hpp b/iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/logger_mock.hpp similarity index 100% rename from iceoryx_utils/testutils/mocks/logger_mock.hpp rename to iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/logger_mock.hpp diff --git a/iceoryx_utils/testutils/mocks/mocks.hpp b/iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/mocks.hpp similarity index 100% rename from iceoryx_utils/testutils/mocks/mocks.hpp rename to iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/mocks.hpp diff --git a/iceoryx_utils/testutils/mocks/mocks.inl b/iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/mocks.inl similarity index 100% rename from iceoryx_utils/testutils/mocks/mocks.inl rename to iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/mocks.inl diff --git a/iceoryx_utils/testutils/mocks/time_mock.hpp b/iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/time_mock.hpp similarity index 94% rename from iceoryx_utils/testutils/mocks/time_mock.hpp rename to iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/time_mock.hpp index 56ef1fc547..45639ce51a 100644 --- a/iceoryx_utils/testutils/mocks/time_mock.hpp +++ b/iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/time_mock.hpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +19,7 @@ #if !defined(_WIN32) && !defined(__APPLE__) -#include "test.hpp" +#include "iceoryx_utils/testing/test.hpp" #include using namespace ::testing; diff --git a/iceoryx_utils/testutils/test.hpp b/iceoryx_utils/testing/include/iceoryx_utils/testing/test.hpp similarity index 100% rename from iceoryx_utils/testutils/test.hpp rename to iceoryx_utils/testing/include/iceoryx_utils/testing/test.hpp diff --git a/iceoryx_utils/testutils/test_definitions.hpp b/iceoryx_utils/testing/include/iceoryx_utils/testing/test_definitions.hpp similarity index 100% rename from iceoryx_utils/testutils/test_definitions.hpp rename to iceoryx_utils/testing/include/iceoryx_utils/testing/test_definitions.hpp diff --git a/iceoryx_utils/testutils/timing_test.hpp b/iceoryx_utils/testing/include/iceoryx_utils/testing/timing_test.hpp similarity index 89% rename from iceoryx_utils/testutils/timing_test.hpp rename to iceoryx_utils/testing/include/iceoryx_utils/testing/timing_test.hpp index 5d87555cbc..48511fd62a 100644 --- a/iceoryx_utils/testutils/timing_test.hpp +++ b/iceoryx_utils/testing/include/iceoryx_utils/testing/timing_test.hpp @@ -1,4 +1,5 @@ // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -69,7 +70,7 @@ { \ std::atomic_bool timingTestResult{true}; \ std::string errorMessages; \ - bool testResult = iox::testutils::performingTimingTest(Test, Repetitions, timingTestResult); \ + bool testResult = iox::utils::testing::performingTimingTest(Test, Repetitions, timingTestResult); \ EXPECT_TRUE(testResult); \ if (!testResult) \ { \ @@ -83,9 +84,11 @@ #define TIMING_TEST_EXPECT_ALWAYS_TRUE(value) EXPECT_TRUE(value) #define TIMING_TEST_EXPECT_ALWAYS_FALSE(value) EXPECT_FALSE(value) #define TIMING_TEST_EXPECT_TRUE(value) \ - errorMessages += iox::testutils::verifyTimingTestResult(__FILE__, __LINE__, #value, value, true, timingTestResult) + errorMessages += \ + iox::utils::testing::verifyTimingTestResult(__FILE__, __LINE__, #value, value, true, timingTestResult) #define TIMING_TEST_EXPECT_FALSE(value) \ - errorMessages += iox::testutils::verifyTimingTestResult(__FILE__, __LINE__, #value, value, false, timingTestResult) + errorMessages += \ + iox::utils::testing::verifyTimingTestResult(__FILE__, __LINE__, #value, value, false, timingTestResult) #define TIMING_TEST_ASSERT_TRUE(value) \ TIMING_TEST_EXPECT_TRUE(value); \ if (!timingTestResult.load()) \ @@ -103,7 +106,9 @@ namespace iox { -namespace testutils +namespace utils +{ +namespace testing { bool performingTimingTest(const std::function& testCallback, const uint64_t repetitions, @@ -117,7 +122,8 @@ std::string verifyTimingTestResult(const char* file, const bool expected, std::atomic_bool& result) noexcept; -} // namespace testutils +} // namespace testing +} // namespace utils } // namespace iox #endif // IOX_UTILS_TESTUTILS_TIMING_TEST_HPP diff --git a/iceoryx_utils/testutils/watch_dog.hpp b/iceoryx_utils/testing/include/iceoryx_utils/testing/watch_dog.hpp similarity index 100% rename from iceoryx_utils/testutils/watch_dog.hpp rename to iceoryx_utils/testing/include/iceoryx_utils/testing/watch_dog.hpp diff --git a/iceoryx_utils/testutils/mocks/time_mock.cpp b/iceoryx_utils/testing/mocks/time_mock.cpp similarity index 92% rename from iceoryx_utils/testutils/mocks/time_mock.cpp rename to iceoryx_utils/testing/mocks/time_mock.cpp index 86fbf60598..551e7c8b59 100644 --- a/iceoryx_utils/testutils/mocks/time_mock.cpp +++ b/iceoryx_utils/testing/mocks/time_mock.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,8 +16,8 @@ // SPDX-License-Identifier: Apache-2.0 #if !defined(_WIN32) && !defined(__APPLE__) -#include "time_mock.hpp" -#include "mocks.hpp" +#include "iceoryx_utils/testing/mocks/time_mock.hpp" +#include "iceoryx_utils/testing/mocks/mocks.hpp" std::unique_ptr time_MOCK::mock; bool time_MOCK::doUseMock = false; diff --git a/iceoryx_utils/testutils/timing_test.cpp b/iceoryx_utils/testing/timing_test.cpp similarity index 91% rename from iceoryx_utils/testutils/timing_test.cpp rename to iceoryx_utils/testing/timing_test.cpp index 03e3ad2d9b..4c69b742fb 100644 --- a/iceoryx_utils/testutils/timing_test.cpp +++ b/iceoryx_utils/testing/timing_test.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,11 +15,13 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "timing_test.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" namespace iox { -namespace testutils +namespace utils +{ +namespace testing { bool performingTimingTest(const std::function& testCallback, const uint64_t repetitions, @@ -56,5 +59,6 @@ std::string verifyTimingTestResult(const char* file, } return errorMessage; } -} // namespace testutils +} // namespace testing +} // namespace utils } // namespace iox diff --git a/tools/gcov/lcov_generate.sh b/tools/gcov/lcov_generate.sh index 9ad463914b..4dccbe3d6e 100755 --- a/tools/gcov/lcov_generate.sh +++ b/tools/gcov/lcov_generate.sh @@ -35,7 +35,7 @@ case "$2" in --rc lcov_branch_coverage=1 lcov -o $OUTPUT_FOLDER/iceoryx_lcov_result_"$TEST_SCOPE".info --rc lcov_branch_coverage=1 -r $OUTPUT_FOLDER/iceoryx_full.info \ - "*/build/*" "*/test/*" "*/iceoryx_examples/*" "*/testutils/*" "*/roudi_environment/*" + "*/build/*" "*/test/*" "*/testing/*" "*/iceoryx_examples/*" genhtml $OUTPUT_FOLDER/iceoryx_lcov_result_"$TEST_SCOPE".info -o $OUTPUT_FOLDER --config-file --legend --show-details --branch-coverage ;;