Merge pull request 'v5.0.0' (#654) from v5.0.0 into development

Reviewed-on: fsfw/fsfw#654
This commit is contained in:
Steffen Gaisser 2022-07-25 14:53:35 +02:00
commit edc5a314b8
43 changed files with 88 additions and 148 deletions

View File

@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
# [unreleased] # [unreleased]
# [v5.0.0] # [v5.0.0] 25.07.2022
## Changes ## Changes

View File

@ -13,7 +13,7 @@ list(APPEND CMAKE_MODULE_PATH
# Version file handling # # Version file handling #
# ############################################################################## # ##############################################################################
set(FSFW_VERSION_IF_GIT_FAILS 4) set(FSFW_VERSION_IF_GIT_FAILS 5)
set(FSFW_SUBVERSION_IF_GIT_FAILS 0) set(FSFW_SUBVERSION_IF_GIT_FAILS 0)
set(FSFW_REVISION_IF_GIT_FAILS 0) set(FSFW_REVISION_IF_GIT_FAILS 0)
@ -104,8 +104,8 @@ if(FSFW_GENERATE_SECTIONS)
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON) option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
endif() endif()
option(FSFW_BUILD_TESTS option(FSFW_BUILD_TESTS "Build unittest binary in addition to static library"
"Build unittest binary in addition to static library" OFF) OFF)
option(FSFW_CICD_BUILD "Build for CI/CD. This can disable problematic test" OFF) option(FSFW_CICD_BUILD "Build for CI/CD. This can disable problematic test" OFF)
option(FSFW_BUILD_DOCS "Build documentation with Sphinx and Doxygen" OFF) option(FSFW_BUILD_DOCS "Build documentation with Sphinx and Doxygen" OFF)
if(FSFW_BUILD_TESTS) if(FSFW_BUILD_TESTS)

View File

@ -16,8 +16,7 @@ cpp_format="clang-format"
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp" file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
if command -v ${cpp_format} &> /dev/null; then if command -v ${cpp_format} &> /dev/null; then
find ./src ${file_selectors} | xargs ${cpp_format} --style=file -i find ./src ${file_selectors} | xargs ${cpp_format} --style=file -i
find ./hal ${file_selectors} | xargs ${cpp_format} --style=file -i find ./unittests ${file_selectors} | xargs ${cpp_format} --style=file -i
find ./tests ${file_selectors} | xargs ${cpp_format} --style=file -i
else else
echo "No ${cpp_format} tool found, not formatting C++/C files" echo "No ${cpp_format} tool found, not formatting C++/C files"
fi fi

View File

@ -1,10 +1,10 @@
#include "fsfw/container/SimpleRingBuffer.h" #include "fsfw/container/SimpleRingBuffer.h"
#include "fsfw/FSFW.h"
#include "fsfw/serviceinterface.h"
#include <cstring> #include <cstring>
#include "fsfw/FSFW.h"
#include "fsfw/serviceinterface.h"
SimpleRingBuffer::SimpleRingBuffer(const size_t size, bool overwriteOld, size_t maxExcessBytes) SimpleRingBuffer::SimpleRingBuffer(const size_t size, bool overwriteOld, size_t maxExcessBytes)
: RingBufferBase<>(0, size, overwriteOld), maxExcessBytes(maxExcessBytes) { : RingBufferBase<>(0, size, overwriteOld), maxExcessBytes(maxExcessBytes) {
if (maxExcessBytes > size) { if (maxExcessBytes > size) {
@ -51,15 +51,15 @@ void SimpleRingBuffer::confirmBytesWritten(size_t amount) {
} }
ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) { ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) {
if(data == nullptr) { if (data == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
} }
if(amount > getMaxSize()) { if (amount > getMaxSize()) {
#if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "SimpleRingBuffer::writeData: Amount of data too large" << std::endl; sif::error << "SimpleRingBuffer::writeData: Amount of data too large" << std::endl;
#else #else
sif::printError("SimpleRingBuffer::writeData: Amount of data too large\n"); sif::printError("SimpleRingBuffer::writeData: Amount of data too large\n");
#endif #endif
#endif #endif
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;

View File

@ -292,7 +292,8 @@ ReturnValue_t MessageQueue::handleOpenError(mq_attr* attributes, uint32_t messag
sif::error << "MessageQueue::MessageQueue: Default MQ size " << defaultMqMaxMsg sif::error << "MessageQueue::MessageQueue: Default MQ size " << defaultMqMaxMsg
<< " is too small for requested message depth " << messageDepth << std::endl; << " is too small for requested message depth " << messageDepth << std::endl;
sif::error << "This error can be fixed by setting the maximum " sif::error << "This error can be fixed by setting the maximum "
"allowed message depth higher" << std::endl; "allowed message depth higher"
<< std::endl;
#else #else
sif::printError( sif::printError(
"MessageQueue::MessageQueue: Default MQ size %d is too small for" "MessageQueue::MessageQueue: Default MQ size %d is too small for"

View File

@ -2,9 +2,9 @@ add_subdirectory(devicehandlers)
add_subdirectory(common) add_subdirectory(common)
if(UNIX) if(UNIX)
add_subdirectory(linux) add_subdirectory(linux)
endif() endif()
if(FSFW_HAL_ADD_STM32H7) if(FSFW_HAL_ADD_STM32H7)
add_subdirectory(stm32h7) add_subdirectory(stm32h7)
endif() endif()

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE GpioCookie.cpp)
GpioCookie.cpp
)

View File

@ -1,5 +1,3 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(
GyroL3GD20Handler.cpp ${LIB_FSFW_NAME} PRIVATE GyroL3GD20Handler.cpp MgmRM3100Handler.cpp
MgmRM3100Handler.cpp MgmLIS3MDLHandler.cpp)
MgmLIS3MDLHandler.cpp
)

View File

@ -1,25 +1,21 @@
if(FSFW_HAL_ADD_RASPBERRY_PI) if(FSFW_HAL_ADD_RASPBERRY_PI)
add_subdirectory(rpi) add_subdirectory(rpi)
endif() endif()
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE UnixFileGuard.cpp CommandExecutor.cpp
UnixFileGuard.cpp utility.cpp)
CommandExecutor.cpp
utility.cpp
)
if(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS) if(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS)
if(FSFW_HAL_LINUX_ADD_LIBGPIOD) if(FSFW_HAL_LINUX_ADD_LIBGPIOD)
add_subdirectory(gpio) add_subdirectory(gpio)
endif() endif()
add_subdirectory(uart) add_subdirectory(uart)
# Adding those does not really make sense on Apple systems which # Adding those does not really make sense on Apple systems which are generally
# are generally host systems. It won't even compile as the headers # host systems. It won't even compile as the headers are missing
# are missing if(NOT APPLE)
if(NOT APPLE) add_subdirectory(i2c)
add_subdirectory(i2c) add_subdirectory(spi)
add_subdirectory(spi) endif()
endif()
endif() endif()
add_subdirectory(uio) add_subdirectory(uio)

View File

@ -1,16 +1,12 @@
# This abstraction layer requires the gpiod library. You can install this library # This abstraction layer requires the gpiod library. You can install this
# with "sudo apt-get install -y libgpiod-dev". If you are cross-compiling, you need # library with "sudo apt-get install -y libgpiod-dev". If you are
# to install the package before syncing the sysroot to your host computer. # cross-compiling, you need to install the package before syncing the sysroot to
# your host computer.
find_library(LIB_GPIO gpiod) find_library(LIB_GPIO gpiod)
if(${LIB_GPIO} MATCHES LIB_GPIO-NOTFOUND) if(${LIB_GPIO} MATCHES LIB_GPIO-NOTFOUND)
message(STATUS "gpiod library not found, not linking against it") message(STATUS "gpiod library not found, not linking against it")
else() else()
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE LinuxLibgpioIF.cpp)
LinuxLibgpioIF.cpp target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${LIB_GPIO})
)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
${LIB_GPIO}
)
endif() endif()

View File

@ -1,8 +1 @@
target_sources(${LIB_FSFW_NAME} PUBLIC target_sources(${LIB_FSFW_NAME} PUBLIC I2cComIF.cpp I2cCookie.cpp)
I2cComIF.cpp
I2cCookie.cpp
)

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE GpioRPi.cpp)
GpioRPi.cpp
)

View File

@ -1,8 +1 @@
target_sources(${LIB_FSFW_NAME} PUBLIC target_sources(${LIB_FSFW_NAME} PUBLIC SpiComIF.cpp SpiCookie.cpp)
SpiComIF.cpp
SpiCookie.cpp
)

View File

@ -1,4 +1 @@
target_sources(${LIB_FSFW_NAME} PUBLIC target_sources(${LIB_FSFW_NAME} PUBLIC UartComIF.cpp UartCookie.cpp)
UartComIF.cpp
UartCookie.cpp
)

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PUBLIC target_sources(${LIB_FSFW_NAME} PUBLIC UioMapper.cpp)
UioMapper.cpp
)

View File

@ -2,6 +2,4 @@ add_subdirectory(spi)
add_subdirectory(gpio) add_subdirectory(gpio)
add_subdirectory(devicetest) add_subdirectory(devicetest)
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE dma.cpp)
dma.cpp
)

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE GyroL3GD20H.cpp)
GyroL3GD20H.cpp
)

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE gpio.cpp)
gpio.cpp
)

View File

@ -1,2 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE)
)

View File

@ -1,9 +1,9 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(
spiCore.cpp ${LIB_FSFW_NAME}
spiDefinitions.cpp PRIVATE spiCore.cpp
spiInterrupts.cpp spiDefinitions.cpp
mspInit.cpp spiInterrupts.cpp
SpiCookie.cpp mspInit.cpp
SpiComIF.cpp SpiCookie.cpp
stm32h743zi.cpp SpiComIF.cpp
) stm32h743zi.cpp)

View File

@ -1,2 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE)
)

View File

@ -1,7 +1,7 @@
if(FSFW_ADD_INTERNAL_TESTS) if(FSFW_ADD_INTERNAL_TESTS)
add_subdirectory(internal) add_subdirectory(internal)
endif() endif()
if(NOT FSFW_BUILD_TESTS) if(NOT FSFW_BUILD_TESTS)
add_subdirectory(integration) add_subdirectory(integration)
endif() endif()

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE TestAssembly.cpp)
TestAssembly.cpp
)

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE TestController.cpp)
TestController.cpp
)

View File

@ -1,5 +1,2 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE TestCookie.cpp TestDeviceHandler.cpp
TestCookie.cpp TestEchoComIF.cpp)
TestDeviceHandler.cpp
TestEchoComIF.cpp
)

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE TestTask.cpp)
TestTask.cpp
)

View File

@ -1,7 +1,5 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE InternalUnitTester.cpp
InternalUnitTester.cpp UnittDefinitions.cpp)
UnittDefinitions.cpp
)
add_subdirectory(osal) add_subdirectory(osal)
add_subdirectory(serialize) add_subdirectory(serialize)

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE TestArrayPrinter.cpp)
TestArrayPrinter.cpp
)

View File

@ -1,5 +1,2 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE testMq.cpp testMutex.cpp
testMq.cpp testSemaphore.cpp)
testMutex.cpp
testSemaphore.cpp
)

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE IntTestSerialization.cpp)
IntTestSerialization.cpp
)

View File

@ -2,6 +2,7 @@
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <cstring> #include <cstring>
#include "CatchDefinitions.h"
#include "fsfw/cfdp/FileSize.h" #include "fsfw/cfdp/FileSize.h"
#include "fsfw/cfdp/pdu/FileDirectiveDeserializer.h" #include "fsfw/cfdp/pdu/FileDirectiveDeserializer.h"
#include "fsfw/cfdp/pdu/FileDirectiveSerializer.h" #include "fsfw/cfdp/pdu/FileDirectiveSerializer.h"
@ -9,7 +10,6 @@
#include "fsfw/cfdp/pdu/HeaderSerializer.h" #include "fsfw/cfdp/pdu/HeaderSerializer.h"
#include "fsfw/globalfunctions/arrayprinter.h" #include "fsfw/globalfunctions/arrayprinter.h"
#include "fsfw/serialize/SerializeAdapter.h" #include "fsfw/serialize/SerializeAdapter.h"
#include "CatchDefinitions.h"
TEST_CASE("CFDP Base", "[CfdpBase]") { TEST_CASE("CFDP Base", "[CfdpBase]") {
using namespace cfdp; using namespace cfdp;

View File

@ -8,8 +8,8 @@
#include <catch2/catch_approx.hpp> #include <catch2/catch_approx.hpp>
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include "LocalPoolOwnerBase.h"
#include "CatchDefinitions.h" #include "CatchDefinitions.h"
#include "LocalPoolOwnerBase.h"
#include "tests/TestsConfig.h" #include "tests/TestsConfig.h"
TEST_CASE("DataSetTest", "[DataSetTest]") { TEST_CASE("DataSetTest", "[DataSetTest]") {

View File

@ -11,8 +11,8 @@
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <iostream> #include <iostream>
#include "LocalPoolOwnerBase.h"
#include "CatchDefinitions.h" #include "CatchDefinitions.h"
#include "LocalPoolOwnerBase.h"
TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { TEST_CASE("LocalPoolManagerTest", "[LocManTest]") {
LocalPoolOwnerBase* poolOwner = LocalPoolOwnerBase* poolOwner =

View File

@ -3,8 +3,8 @@
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include "LocalPoolOwnerBase.h"
#include "CatchDefinitions.h" #include "CatchDefinitions.h"
#include "LocalPoolOwnerBase.h"
#include "tests/TestsConfig.h" #include "tests/TestsConfig.h"
TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") { TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") {

View File

@ -3,8 +3,8 @@
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include "LocalPoolOwnerBase.h"
#include "CatchDefinitions.h" #include "CatchDefinitions.h"
#include "LocalPoolOwnerBase.h"
#include "tests/TestsConfig.h" #include "tests/TestsConfig.h"
TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") { TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") {

View File

@ -2,9 +2,9 @@
#include "ComIFMock.h" #include "ComIFMock.h"
#include "DeviceFdirMock.h" #include "DeviceFdirMock.h"
#include "devicehandler/CookieIFMock.h"
#include "DeviceHandlerCommander.h" #include "DeviceHandlerCommander.h"
#include "DeviceHandlerMock.h" #include "DeviceHandlerMock.h"
#include "devicehandler/CookieIFMock.h"
#include "objects/systemObjectList.h" #include "objects/systemObjectList.h"
TEST_CASE("Device Handler Base", "[DeviceHandlerBase]") { TEST_CASE("Device Handler Base", "[DeviceHandlerBase]") {

View File

@ -1,8 +1,8 @@
#include <array> #include <array>
#include "CatchDefinitions.h"
#include "catch2/catch_test_macros.hpp" #include "catch2/catch_test_macros.hpp"
#include "fsfw/globalfunctions/CRC.h" #include "fsfw/globalfunctions/CRC.h"
#include "CatchDefinitions.h"
TEST_CASE("CRC", "[CRC]") { TEST_CASE("CRC", "[CRC]") {
std::array<uint8_t, 10> testData = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; std::array<uint8_t, 10> testData = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

View File

@ -1,8 +1,8 @@
#include <array> #include <array>
#include "CatchDefinitions.h"
#include "catch2/catch_test_macros.hpp" #include "catch2/catch_test_macros.hpp"
#include "fsfw/globalfunctions/DleEncoder.h" #include "fsfw/globalfunctions/DleEncoder.h"
#include "CatchDefinitions.h"
const std::vector<uint8_t> TEST_ARRAY_0 = {0, 0, 0, 0, 0}; const std::vector<uint8_t> TEST_ARRAY_0 = {0, 0, 0, 0, 0};
const std::vector<uint8_t> TEST_ARRAY_1 = {0, DleEncoder::DLE_CHAR, 5}; const std::vector<uint8_t> TEST_ARRAY_1 = {0, DleEncoder::DLE_CHAR, 5};

View File

@ -8,11 +8,11 @@
#include <array> #include <array>
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include "CatchDefinitions.h"
#include "fsfw/action/ActionMessage.h" #include "fsfw/action/ActionMessage.h"
#include "fsfw/ipc/CommandMessage.h" #include "fsfw/ipc/CommandMessage.h"
#include "fsfw/ipc/MessageQueueMessage.h" #include "fsfw/ipc/MessageQueueMessage.h"
#include "fsfw/objectmanager/frameworkObjects.h" #include "fsfw/objectmanager/frameworkObjects.h"
#include "CatchDefinitions.h"
#include "mocks/PeriodicTaskIFMock.h" #include "mocks/PeriodicTaskIFMock.h"
TEST_CASE("Internal Error Reporter", "[TestInternalError]") { TEST_CASE("Internal Error Reporter", "[TestInternalError]") {

View File

@ -4,11 +4,11 @@
#include <cstring> #include <cstring>
#include <queue> #include <queue>
#include "CatchDefinitions.h"
#include "fsfw/ipc/CommandMessage.h" #include "fsfw/ipc/CommandMessage.h"
#include "fsfw/ipc/MessageQueueBase.h" #include "fsfw/ipc/MessageQueueBase.h"
#include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/ipc/MessageQueueMessage.h" #include "fsfw/ipc/MessageQueueMessage.h"
#include "CatchDefinitions.h"
class MessageQueueMockBase : public MessageQueueBase { class MessageQueueMockBase : public MessageQueueBase {
public: public:

View File

@ -1,9 +1,9 @@
#include <fsfw/power/DummyPowerSwitcher.h> #include <fsfw/power/DummyPowerSwitcher.h>
#include <fsfw/power/PowerSwitcher.h> #include <fsfw/power/PowerSwitcher.h>
#include "mocks/PowerSwitcherMock.h"
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include "mocks/PowerSwitcherMock.h"
#include "objects/systemObjectList.h" #include "objects/systemObjectList.h"
TEST_CASE("Power Switcher", "[power-switcher]") { TEST_CASE("Power Switcher", "[power-switcher]") {

View File

@ -1,10 +1,9 @@
#include "fsfw/version.h"
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include "fsfw/serviceinterface.h"
#include "CatchDefinitions.h" #include "CatchDefinitions.h"
#include "fsfw/serviceinterface.h"
#include "fsfw/version.h"
TEST_CASE("Version API Tests", "[TestVersionAPI]") { TEST_CASE("Version API Tests", "[TestVersionAPI]") {
// Check that major version is non-zero // Check that major version is non-zero