-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multithread test support Fix typo Test CI Set library full path and dependencies Modify client link method Add link_directories Trigger CI Fix include paths Trigger CI Update CMakeLists.txt Fix create bin field Revert cmake change Update participant name
- Loading branch information
1 parent
19537f8
commit f9396ee
Showing
11 changed files
with
203 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). | ||
# | ||
# 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. | ||
|
||
cmake_host_system_information(RESULT HOSTNAME_SUFFIX QUERY HOSTNAME) | ||
|
||
add_executable(client-thread-test ClientAgentInteractionThread.cpp) | ||
|
||
add_gtest(client-thread-test | ||
SOURCES | ||
ClientAgentInteractionThread.cpp | ||
ENVIRONMENTS | ||
$<$<PLATFORM_ID:Linux>:LD_LIBRARY_PATH=${CMAKE_PREFIX_PATH}/lib> | ||
$<$<PLATFORM_ID:Windows>:PATH=${CMAKE_PREFIX_PATH}/bin> | ||
) | ||
|
||
target_include_directories(client-thread-test | ||
PRIVATE | ||
${PROJECT_BINARY_DIR}/microxrcedds-build/itests | ||
${GTEST_INCLUDE_DIR} | ||
) | ||
|
||
target_link_libraries(client-thread-test | ||
PRIVATE | ||
interaction_thread_client | ||
microxrcedds_agent | ||
${GTEST_BOTH_LIBRARIES} | ||
${CMAKE_THREAD_LIBS_INIT} | ||
) | ||
|
||
set_target_properties(client-thread-test PROPERTIES | ||
CXX_STANDARD | ||
11 | ||
CXX_STANDARD_REQUIRED | ||
YES | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <gtest/gtest.h> | ||
#include <thread> | ||
|
||
#include <Client.hpp> | ||
#include "../client_agent/ClientAgentInteraction.hpp" | ||
|
||
class ClientAgentInteractionThread : public ClientAgentInteraction | ||
{ | ||
}; | ||
|
||
TEST_P(ClientAgentInteractionThread, PingFromClientToAgentThread) | ||
{ | ||
const Transport transport_kind(std::get<0>(GetParam())); | ||
|
||
std::string message("Hello DDS world!"); | ||
std::thread ping_thread(&Client::ping_agent, client_, transport_kind, 10, 1); | ||
std::thread publisher_thread(&Client::publish_run, client_, 1, 1, 10, message); | ||
publisher_thread.join(); | ||
ping_thread.join(); | ||
} | ||
|
||
INSTANTIATE_TEST_CASE_P( | ||
Transports, | ||
ClientAgentInteractionThread, | ||
::testing::Combine( | ||
::testing::Values(Transport::UDP_IPV4_TRANSPORT, Transport::TCP_IPV4_TRANSPORT, Transport::UDP_IPV6_TRANSPORT, Transport::TCP_IPV6_TRANSPORT), | ||
::testing::Values(MiddlewareKind::FASTDDS, MiddlewareKind::FASTRTPS, MiddlewareKind::CED))); | ||
|
||
int main(int args, char** argv) | ||
{ | ||
::testing::InitGoogleTest(&args, argv); | ||
return RUN_ALL_TESTS(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters