restructured test folder and enabled cmake v3 support

This commit is contained in:
Robin Müller 2020-12-27 14:14:38 +01:00
parent 426514b9a2
commit 37463b660b
58 changed files with 132 additions and 57 deletions

2
unittest/CMakeLists.txt Normal file
View File

@ -0,0 +1,2 @@
add_subdirectory(internal)
add_subdirectory(tests)

View File

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

View File

@ -0,0 +1,5 @@
target_sources(${TARGET_NAME} PRIVATE
IntTestMq.cpp
IntTestMutex.cpp
IntTestSemaphore.cpp
)

View File

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

View File

@ -0,0 +1,6 @@
add_subdirectory(action)
add_subdirectory(container)
add_subdirectory(osal)
add_subdirectory(serialize)
add_subdirectory(storagemanager)

View File

@ -0,0 +1,3 @@
target_sources(${TARGET_NAME} PRIVATE
TestActionHelper.cpp
)

View File

@ -1,8 +1,11 @@
#include "TestActionHelper.h"
#include <unittest/core/CatchDefinitions.h>
#include <fsfw/action/ActionHelper.h>
#include <fsfw/ipc/CommandMessage.h>
#include <catch2/catch.hpp>
#include "../../core/CatchDefinitions.h"
#include <catch2/catch_test_macros.hpp>
TEST_CASE( "Action Helper" , "[ActionHelper]") {

View File

@ -3,7 +3,7 @@
#include <fsfw/action/HasActionsIF.h>
#include <fsfw/ipc/MessageQueueIF.h>
#include <fsfw/unittest/core/CatchDefinitions.h>
#include <unittest/core/CatchDefinitions.h>
#include <cstring>

View File

@ -0,0 +1,10 @@
target_sources(${TARGET_NAME} PRIVATE
RingBufferTest.cpp
TestArrayList.cpp
TestDynamicFifo.cpp
TestFifo.cpp
TestFixedArrayList.cpp
TestFixedMap.cpp
TestFixedOrderedMultimap.cpp
TestPlacementFactory.cpp
)

View File

@ -1,7 +1,7 @@
#include "../../core/CatchDefinitions.h"
#include "../../container/SimpleRingBuffer.h"
#include <unittest/core/CatchDefinitions.h>
#include <fsfw/container/SimpleRingBuffer.h>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <cstring>
TEST_CASE("Ring Buffer Test" , "[RingBufferTest]") {

View File

@ -1,8 +1,8 @@
#include "../../container/ArrayList.h"
#include "../../returnvalues/HasReturnvaluesIF.h"
#include <fsfw/container/ArrayList.h>
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include <catch2/catch.hpp>
#include "../../core/CatchDefinitions.h"
#include <catch2/catch_test_macros.hpp>
#include <unittest/core/CatchDefinitions.h>
/**
* @brief Array List test

View File

@ -1,10 +1,9 @@
#include "../../../container/DynamicFIFO.h"
#include "../../../container/FIFO.h"
#include "../../../returnvalues/HasReturnvaluesIF.h"
#include "../../container/DynamicFIFO.h"
#include "../../container/FIFO.h"
#include "../../returnvalues/HasReturnvaluesIF.h"
#include <catch.hpp>
#include <CatchDefinitions.h>
#include <catch2/catch_test_macros.hpp>
#include <unittest/core/CatchDefinitions.h>
TEST_CASE( "Dynamic Fifo Tests", "[TestDynamicFifo]") {
INFO("Dynamic Fifo Tests");

View File

@ -1,10 +1,9 @@
#include "../../../container/DynamicFIFO.h"
#include "../../../container/FIFO.h"
#include "../../../returnvalues/HasReturnvaluesIF.h"
#include "../../container/DynamicFIFO.h"
#include "../../container/FIFO.h"
#include "../../returnvalues/HasReturnvaluesIF.h"
#include <catch2/catch.hpp>
#include "../../core/CatchDefinitions.h"
#include <catch2/catch_test_macros.hpp>
#include <unittest/core/CatchDefinitions.h>
TEST_CASE( "Static Fifo Tests", "[TestFifo]") {
INFO("Fifo Tests");

View File

@ -1,9 +1,8 @@
#include "../../core/CatchDefinitions.h"
#include "../../../container/FixedArrayList.h"
#include "../../../returnvalues/HasReturnvaluesIF.h"
#include "../../container/FixedArrayList.h"
#include "../../returnvalues/HasReturnvaluesIF.h"
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <unittest/core/CatchDefinitions.h>
TEST_CASE( "FixedArrayList Tests", "[TestFixedArrayList]") {

View File

@ -1,8 +1,8 @@
#include "../../container/FixedMap.h"
#include "../../returnvalues/HasReturnvaluesIF.h"
#include "../../../container/FixedMap.h"
#include "../../../returnvalues/HasReturnvaluesIF.h"
#include <catch2/catch.hpp>
#include "../../core/CatchDefinitions.h"
#include <catch2/catch_test_macros.hpp>
#include <unittest/core/CatchDefinitions.h>
template class FixedMap<unsigned int, unsigned short>;

View File

@ -1,8 +1,8 @@
#include "../../container/FixedOrderedMultimap.h"
#include "../../returnvalues/HasReturnvaluesIF.h"
#include "../../../container/FixedOrderedMultimap.h"
#include "../../../returnvalues/HasReturnvaluesIF.h"
#include <catch2/catch.hpp>
#include "../../core/CatchDefinitions.h"
#include <catch2/catch_test_macros.hpp>
#include <unittest/core/CatchDefinitions.h>
TEST_CASE( "FixedOrderedMultimap Tests", "[TestFixedOrderedMultimap]") {
INFO("FixedOrderedMultimap Tests");

View File

@ -0,0 +1,4 @@
target_sources(${TARGET_NAME} PRIVATE
TestMessageQueue.cpp
TestSemaphore.cpp
)

View File

@ -1,8 +1,10 @@
#include "../../ipc/MessageQueueIF.h"
#include "../../ipc/QueueFactory.h"
#include <catch.hpp>
#include "../../../ipc/MessageQueueIF.h"
#include "../../../ipc/QueueFactory.h"
#include <catch2/catch_test_macros.hpp>
#include <unittest/core/CatchDefinitions.h>
#include <array>
#include "../../core/CatchDefinitions.h"
TEST_CASE("MessageQueue Basic Test","[TestMq]") {
MessageQueueIF* testSenderMq =

View File

@ -0,0 +1,5 @@
target_sources(${TARGET_NAME} PRIVATE
TestSerialBufferAdapter.cpp
TestSerialization.cpp
TestSerialLinkedPacket.cpp
)

View File

@ -1,7 +1,9 @@
#include "../../serialize/SerialBufferAdapter.h"
#include "../../../serialize/SerialBufferAdapter.h"
#include <catch2/catch.hpp>
#include "../../core/CatchDefinitions.h"
#include <catch2/catch_test_macros.hpp>
#include <unittest/core/CatchDefinitions.h>
#include <array>
static bool test_value_bool = true;

View File

@ -1,9 +1,12 @@
#include "TestSerialLinkedPacket.h"
#include "../../core/CatchDefinitions.h"
#include <unittest/core/CatchDefinitions.h>
#include "../../globalfunctions/arrayprinter.h"
#include "../../../globalfunctions/arrayprinter.h"
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <unittest/core/CatchDefinitions.h>
#include <array>
TEST_CASE("Serial Linked Packet" , "[SerLinkPacket]") {

View File

@ -37,7 +37,7 @@ public:
return buffer.entry.getConstBuffer();
}
const size_t getBufferLength() {
size_t getBufferLength() {
return buffer.getSerializedSize();
}

View File

@ -1,8 +1,10 @@
#include "../../serialize/SerializeAdapter.h"
#include "../../../serialize/SerializeAdapter.h"
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <unittest/core/CatchDefinitions.h>
#include "catch.hpp"
#include <array>
#include "../../core/CatchDefinitions.h"
static bool test_value_bool = true;
static uint8_t tv_uint8 {5};
@ -119,10 +121,10 @@ TEST_CASE("Auto Serialize Adapter testing", "[single-file]") {
REQUIRE(tv_int16 == -829);
REQUIRE(tv_int32 == -2312);
REQUIRE(tv_float == Approx(8.214921));
REQUIRE(tv_double == Approx(9.2132142141e8));
REQUIRE(tv_sfloat == Approx(-922.2321321));
REQUIRE(tv_sdouble == Approx(-2.2421e19));
REQUIRE(tv_float == Catch::Approx(8.214921));
REQUIRE(tv_double == Catch::Approx(9.2132142141e8));
REQUIRE(tv_sfloat == Catch::Approx(-922.2321321));
REQUIRE(tv_sdouble == Catch::Approx(-2.2421e19));
}
}

View File

@ -0,0 +1,4 @@
target_sources(${TARGET_NAME} PRIVATE
TestNewAccessor.cpp
TestPool.cpp
)

View File

@ -1,10 +1,8 @@
#include "CatchDefinitions.h"
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/storagemanager/LocalPool.h>
#include <catch.hpp>
#include <CatchDefinitions.h>
#include <catch2/catch_test_macros.hpp>
#include <unittest/core/CatchDefinitions.h>
#include <cstring>

View File

@ -0,0 +1 @@
add_subdirectory(core)

View File

@ -0,0 +1,11 @@
target_sources(${TARGET_NAME}
PRIVATE
ipc/MissionMessageTypes.cpp
pollingsequence/PollingSequenceFactory.cpp
)
# Add include paths for the executable
target_include_directories(${TARGET_NAME}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@ -0,0 +1,7 @@
target_sources(${TARGET_NAME} PRIVATE
CatchDefinitions.cpp
CatchFactory.cpp
CatchRunner.cpp
CatchSetup.cpp
printChar.cpp
)