diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index dd84ea7824..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7d61..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.gitmodules b/.gitmodules index 74da17fb90..29a0412525 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "thirdparty/spdlog"] path = thirdparty/spdlog url = https://github.com/gabime/spdlog.git +[submodule "thirdparty/googletest"] + path = thirdparty/googletest + url = https://github.com/google/googletest.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ebd069b56..a140f666a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,8 @@ option(BUILD_APPS "Build the eCAL applications" option(BUILD_SAMPLES "Build the eCAL samples" ON) option(BUILD_TIME "Build the eCAL time interfaces" ON) option(BUILD_PY_BINDING "Build eCAL python binding" OFF) -option(ECAL_LAYER_FASTRTPS "Provide fast rtps as communication layer" OFF) +option(BUILD_TESTS "Build the eCAL google tests" OFF) + option(ECAL_LAYER_ICEORYX "Provide iceoryx as communication layer" OFF) option(ECAL_INCLUDE_PY_SAMPLES "Include python language sample projects into CMake" OFF) @@ -55,8 +56,9 @@ option(ECAL_NPCAP_SUPPORT "Enable the eCAL Npcap Receiver ( # Set option regarding third party library builds option(ECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS "Build CMakeFunctions with eCAL" ON) -option(ECAL_THIRDPARTY_BUILD_PROTOBUF "Build Protobuf with eCAL" ON) +option(ECAL_THIRDPARTY_BUILD_PROTOBUF "Build protobuf with eCAL" ON) option(ECAL_THIRDPARTY_BUILD_SPDLOG "Build spdlog with eCAL" ON) +option(ECAL_THIRDPARTY_BUILD_GTEST "Build gtest with eCAL" OFF) set(ECAL_INSTALL_PYTHON_DIR "bin" CACHE PATH "Location to install the Python extension modules. Might be set by setupdtools install.") @@ -79,7 +81,7 @@ message(STATUS "Prefix Path: ${CMAKE_PREFIX_PATH}") # -------------------------------------------------------- # third party dependencies as requested # -------------------------------------------------------- -if (ECAL_THIRDPARTY_BUILD_PROTOBUF OR ECAL_THIRDPARTY_BUILD_SPDLOG) +if (ECAL_THIRDPARTY_BUILD_PROTOBUF OR ECAL_THIRDPARTY_BUILD_SPDLOG OR ECAL_THIRDPARTY_BUILD_GTEST) if(MSVC) # supress thirdparty warnings for windows platform set(CMAKE_CXX_FLAGS_OLD "${CMAKE_CXX_FLAGS}") @@ -115,7 +117,24 @@ if (ECAL_THIRDPARTY_BUILD_SPDLOG) add_library(spdlog::spdlog ALIAS spdlog) endif () -if (ECAL_THIRDPARTY_BUILD_PROTOBUF OR ECAL_THIRDPARTY_BUILD_SPDLOG) +if (ECAL_THIRDPARTY_BUILD_GTEST) + list(APPEND as_subproject GTest) + # Googletest automatically forces MT instead of MD if we do not set this option. + if(MSVC) + set(gtest_force_shared_crt ON CACHE BOOL "My option" FORCE) + set(BUILD_GMOCK OFF CACHE BOOL "My option" FORCE) + set(INSTALL_GTEST OFF CACHE BOOL "My option" FORCE) + endif() + add_subdirectory(thirdparty/googletest) + if(NOT TARGET GTest::GTest) + add_library(GTest::GTest ALIAS gtest) + endif() + if(NOT TARGET GTest::Main) + add_library(GTest::Main ALIAS gtest_main) + endif() +endif() + +if (ECAL_THIRDPARTY_BUILD_PROTOBUF OR ECAL_THIRDPARTY_BUILD_SPDLOG OR ECAL_THIRDPARTY_BUILD_GTEST) if(MSVC) # reset thirdparty warnings for windows platform set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_OLD}") @@ -298,6 +317,7 @@ add_subdirectory(ecal/core/src) # custom libs # -------------------------------------------------------- add_subdirectory(lib/ThreadingUtils) +add_subdirectory(lib/CustomTclap) add_subdirectory(lib/EcalUtils) if(HAS_QT5) add_subdirectory(lib/CustomQt) @@ -374,7 +394,7 @@ if(BUILD_APPS AND HAS_QT5) endif() add_subdirectory(app/mon/eCALMonPlugins) # -------------------------------------------------------- -# Qt5 Apps using HDF5 +# qt applications using hdf5 # -------------------------------------------------------- if(BUILD_APPS AND HAS_QT5 AND HAS_HDF5) add_subdirectory(app/play/eCALPlayGUI) @@ -383,12 +403,40 @@ endif() endif() # -------------------------------------------------------- -# Samples +# samples # -------------------------------------------------------- if(BUILD_SAMPLES) add_subdirectory(samples) endif() +# -------------------------------------------------------- +# unit tests +# -------------------------------------------------------- +if(BUILD_TESTS) + enable_testing() + + # ------------------------------------------------------ + # test contrib + # ------------------------------------------------------ + if(HAS_HDF5) + add_subdirectory(testing/contrib/ecalhdf5/hdf5_test/src) + endif() + add_subdirectory(testing/contrib/ecalproto/dynproto_test/src) + add_subdirectory(testing/contrib/ecalproto/ecal_proto_test/src) + + # ------------------------------------------------------ + # test ecal + # ------------------------------------------------------ + add_subdirectory(testing/ecal/clientserver_test/src) + add_subdirectory(testing/ecal/core_test/src) + add_subdirectory(testing/ecal/event_test/src) + add_subdirectory(testing/ecal/expmap_test/src) + add_subdirectory(testing/ecal/io_memfile_test/src) + add_subdirectory(testing/ecal/pubsub_inproc_test/src) + add_subdirectory(testing/ecal/pubsub_proto_test/src) + add_subdirectory(testing/ecal/pubsub_test/src) +endif() + # -------------------------------------------------------- # configs # -------------------------------------------------------- diff --git a/NOTICE.txt b/NOTICE.txt index 4e0860c30b..ebdc70a476 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -21,7 +21,7 @@ This project has dependencies - list with dependency name and license follows. - Apache License 2.0 - https://www.apache.org/licenses/LICENSE-2.0 - Boost Software License - http://www.boost.org/LICENSE_1_0.txt - - BSD 2-Clause License - http://www.opensource.org/licenses/bsd-license.php + - BSD 3-Clause License - https://opensource.org/licenses/BSD-3-Clause - GNU Lesser General Public License v2.1 - https://www.gnu.org/licenses/old-licenses/lgpl-2.1.de.html - GNU Lesser General Public License v3 - https://www.gnu.org/licenses/lgpl-3.0.de.html - MIT License - https://opensource.org/licenses/MIT @@ -36,17 +36,8 @@ This project has dependencies - list with dependency name and license follows. - Copyright © 2003-2018 Christopher M. Kohlhoff - URL: https://think-async.com - License: Boost Software License - http://www.boost.org/LICENSE_1_0.txt - -2.1.2 LCM-Lite - - URL: https://github.com/lcm-proj/lcm/tree/master/lcm-lite - - License: GNU Lesser General Public License v2.1 - https://github.com/lcm-proj/lcm/blob/master/COPYING - -2.1.3 FastRTPS / FastCDR - - Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima) - - URL: https://github.com/eProsima/Fast-RTPS - - License: Apache License 2.0 - https://github.com/eProsima/Fast-RTPS/blob/master/LICENSE -2.1.4 NPCAP +2.1.2 NPCAP - Copyright 2013-2016 by Insecure.Com LLC - URL: https://nmap.org/npcap/ - License: Npcap License - https://github.com/nmap/npcap/blob/master/LICENSE @@ -99,3 +90,10 @@ This project has dependencies - list with dependency name and license follows. - Copyright 2013-2019 Freepik Company S.L. All rights reserved. - URL: https://www.flaticon.com/ - License: Creative Commons 3.0 - https://creativecommons.org/licenses/by/3.0 + +2.5 Testing + +2.5.1 GoogleTest + - Copyright 2008 Google Inc. + - URL: https://github.com/google/googletest + - License: BSD 3-Clause License - https://github.com/google/googletest/blob/master/LICENSE.txt diff --git a/PVSSettings.xml b/PVSSettings.xml index 71628d0473..d49ceb2ade 100644 --- a/PVSSettings.xml +++ b/PVSSettings.xml @@ -15,9 +15,6 @@ \qt\ \_build\ - \ecal\core\src\readwrite\fastrtps\string_message_PubSubTypes.cxx - \ecal\core\src\readwrite\fastrtps\string_message_.cxx - \ecal\core\src\readwrite\lcm\lcmlite.cpp \thirdparty\ toolstrip_L3Warnings toolStripButton_OP toolStripButton_64 diff --git a/README.md b/README.md index 505d463523..76b6334d8d 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ additional informations like a unique name, a type and a description. A topic ca • Callback: A Callback can be used to react on time events, on incoming messages, on service requests or service responses. -eCAL is simplifying the data transport as much as possible, It uses different mechanism to transport a topic from a publisher to a connected subscriber. On the same computer node the data are exchanged by using memory mapped files. Between different computing nodes UDP multicast can be used for high performance data throughput, rtps can be used for reliable data transport. +eCAL is simplifying the data transport as much as possible, It uses different mechanism to transport a topic from a publisher to a connected subscriber. On the same computer node the data are exchanged by using memory mapped files. Between different computing nodes UDP multicast can be used for high performance data throughput. ## Checkout the repository @@ -67,8 +67,8 @@ eCAL is using CMake as build system. When configuring with CMake, you can turn o Build the eCAL time interfaces, necessary if you want to use ecal in time synchronized mode (based on ptp for example) - `BUILD_PY_BINDING`, default `OFF` Build the eCAL python language binding -- `ECAL_LAYER_FASTRTPS`, default `OFF` - Provide fast rtps as communication layer, requires fast-rtps and fast-cdr installations +- `BUILD_TESTS', default `OFF` + Build the eCAL google tests - `ECAL_LAYER_ICEORYX`, default `OFF` Provide iceoryx as communication layer, requires [eclipse/iceoryx](https://github.com/eclipse/iceoryx) installation - `ECAL_INCLUDE_PY_SAMPLES`, default: `OFF` @@ -83,6 +83,8 @@ eCAL is using CMake as build system. When configuring with CMake, you can turn o Build Protobuf with eCAL, included as a submodule in the thirdparty folder. You can always use your custom protobuf installation, this is only for convenience. Note, at least protobuf 3.0 is required to compile eCAL, we recommend using 3.5.1 or newer (tested with 3.5.1). - `ECAL_THIRDPARTY_BUILD_SPDLOG`, default `ON` Build Spdlog with eCAL, included as a submodule in the thirdparty folder. You can always use your custom spdlog installation, this is only for convenience. +- `ECAL_THIRDPARTY_BUILD_GTEST`, default `OFF` + Build GoogleTest with eCAL, included as a submodule in the thirdparty folder. You can always use your custom gtest installation, this is only for convenience. All options can be passed on the command line `cmake -D