apply auto-formatter
fsfw/fsfw/pipeline/pr-development This commit looks good Details

This commit is contained in:
Robin Müller 2022-07-18 16:08:06 +02:00
parent 6f751c2cf9
commit 74794bb71b
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
40 changed files with 77 additions and 137 deletions

View File

@ -104,8 +104,8 @@ if(FSFW_GENERATE_SECTIONS)
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
endif()
option(FSFW_BUILD_TESTS
"Build unittest binary in addition to static library" OFF)
option(FSFW_BUILD_TESTS "Build unittest binary in addition to static library"
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)
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"
if command -v ${cpp_format} &> /dev/null; then
find ./src ${file_selectors} | xargs ${cpp_format} --style=file -i
find ./hal ${file_selectors} | xargs ${cpp_format} --style=file -i
find ./tests ${file_selectors} | xargs ${cpp_format} --style=file -i
find ./unittests ${file_selectors} | xargs ${cpp_format} --style=file -i
else
echo "No ${cpp_format} tool found, not formatting C++/C files"
fi

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,16 +1,12 @@
# This abstraction layer requires the gpiod library. You can install this library
# with "sudo apt-get install -y libgpiod-dev". If you are cross-compiling, you need
# to install the package before syncing the sysroot to your host computer.
# This abstraction layer requires the gpiod library. You can install this
# library with "sudo apt-get install -y libgpiod-dev". If you are
# cross-compiling, you need to install the package before syncing the sysroot to
# your host computer.
find_library(LIB_GPIO gpiod)
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()
target_sources(${LIB_FSFW_NAME} PRIVATE
LinuxLibgpioIF.cpp
)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
${LIB_GPIO}
)
target_sources(${LIB_FSFW_NAME} PRIVATE LinuxLibgpioIF.cpp)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${LIB_GPIO})
endif()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
gpio.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE 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
spiCore.cpp
spiDefinitions.cpp
spiInterrupts.cpp
mspInit.cpp
SpiCookie.cpp
SpiComIF.cpp
stm32h743zi.cpp
)
target_sources(
${LIB_FSFW_NAME}
PRIVATE spiCore.cpp
spiDefinitions.cpp
spiInterrupts.cpp
mspInit.cpp
SpiCookie.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)
add_subdirectory(internal)
add_subdirectory(internal)
endif()
if(NOT FSFW_BUILD_TESTS)
add_subdirectory(integration)
add_subdirectory(integration)
endif()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,8 +1,8 @@
#include <array>
#include "CatchDefinitions.h"
#include "catch2/catch_test_macros.hpp"
#include "fsfw/globalfunctions/CRC.h"
#include "CatchDefinitions.h"
TEST_CASE("CRC", "[CRC]") {
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 "CatchDefinitions.h"
#include "catch2/catch_test_macros.hpp"
#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_1 = {0, DleEncoder::DLE_CHAR, 5};

View File

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

View File

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

View File

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

View File

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