fixes includes
This commit is contained in:
parent
fdf35232ee
commit
78b09ed0c9
@ -104,11 +104,11 @@ if(FSFW_GENERATE_SECTIONS)
|
||||
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
|
||||
endif()
|
||||
|
||||
option(FSFW_BUILD_UNITTESTS
|
||||
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_UNITTESTS)
|
||||
if(FSFW_BUILD_TESTS)
|
||||
option(FSFW_TESTS_GEN_COV "Generate coverage data for unittests" ON)
|
||||
endif()
|
||||
|
||||
@ -140,7 +140,7 @@ if(IPO_SUPPORTED AND FSFW_ENABLE_IPO)
|
||||
TRUE)
|
||||
endif()
|
||||
|
||||
if(FSFW_BUILD_UNITTESTS)
|
||||
if(FSFW_BUILD_TESTS)
|
||||
message(
|
||||
STATUS
|
||||
"${MSG_PREFIX} Building the FSFW unittests in addition to the static library"
|
||||
@ -163,7 +163,7 @@ if(FSFW_BUILD_UNITTESTS)
|
||||
list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2)
|
||||
endif()
|
||||
|
||||
set(FSFW_CONFIG_PATH unittests/testcfg/)
|
||||
set(FSFW_CONFIG_PATH unittests/testcfg)
|
||||
configure_file(unittests/testcfg/FSFWConfig.h.in FSFWConfig.h)
|
||||
configure_file(unittests/testcfg/TestsConfig.h.in tests/TestsConfig.h)
|
||||
|
||||
@ -282,11 +282,14 @@ message(
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(contrib)
|
||||
if(FSFW_BUILD_TESTS)
|
||||
add_subdirectory(unittests)
|
||||
endif()
|
||||
if(FSFW_BUILD_DOCS)
|
||||
add_subdirectory(docs)
|
||||
endif()
|
||||
|
||||
if(FSFW_BUILD_UNITTESTS)
|
||||
if(FSFW_BUILD_TESTS)
|
||||
if(FSFW_TESTS_GEN_COV)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
include(CodeCoverage)
|
||||
|
@ -165,10 +165,10 @@ def create_tests_build_cfg(args):
|
||||
os.mkdir(UNITTEST_FOLDER_NAME)
|
||||
os.chdir(UNITTEST_FOLDER_NAME)
|
||||
if args.windows:
|
||||
cmake_cmd = 'cmake -G "' + args.generators + '" -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON \
|
||||
cmake_cmd = 'cmake -G "' + args.generators + '" -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON \
|
||||
-DGCOVR_PATH="py -m gcovr" ..'
|
||||
else:
|
||||
cmake_cmd = 'cmake -G "' + args.generators + '" -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..'
|
||||
cmake_cmd = 'cmake -G "' + args.generators + '" -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON ..'
|
||||
cmd_runner(cmake_cmd)
|
||||
os.chdir("..")
|
||||
|
||||
|
@ -2,6 +2,6 @@ if(FSFW_ADD_INTERNAL_TESTS)
|
||||
add_subdirectory(internal)
|
||||
endif()
|
||||
|
||||
if(NOT FSFW_BUILD_UNITTESTS)
|
||||
if(NOT FSFW_BUILD_TESTS)
|
||||
add_subdirectory(integration)
|
||||
endif()
|
||||
|
@ -27,3 +27,5 @@ add_subdirectory(cfdp)
|
||||
add_subdirectory(hal)
|
||||
add_subdirectory(internalerror)
|
||||
add_subdirectory(devicehandler)
|
||||
|
||||
target_include_directories(${FSFW_TEST_TGT} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <array>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/mocks/MessageQueueMockBase.h"
|
||||
#include "mocks/MessageQueueMockBase.h"
|
||||
|
||||
TEST_CASE("Action Helper", "[ActionHelper]") {
|
||||
ActionHelperOwnerMockBase testDhMock;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
class ActionHelperOwnerMockBase : public HasActionsIF {
|
||||
public:
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "fsfw/cfdp/pdu/HeaderSerializer.h"
|
||||
#include "fsfw/globalfunctions/arrayprinter.h"
|
||||
#include "fsfw/serialize/SerializeAdapter.h"
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("CFDP Base", "[CfdpBase]") {
|
||||
using namespace cfdp;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <cstring>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("Ring Buffer Test", "[RingBufferTest]") {
|
||||
uint8_t testData[13] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
/**
|
||||
* @brief Array List test
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("Dynamic Fifo Tests", "[TestDynamicFifo]") {
|
||||
INFO("Dynamic Fifo Tests");
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("Static Fifo Tests", "[TestFifo]") {
|
||||
INFO("Fifo Tests");
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("FixedArrayList Tests", "[TestFixedArrayList]") {
|
||||
INFO("FixedArrayList Tests");
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
template class FixedMap<unsigned int, unsigned short>;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("FixedOrderedMultimap Tests", "[TestFixedOrderedMultimap]") {
|
||||
INFO("FixedOrderedMultimap Tests");
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("PlacementFactory Tests", "[TestPlacementFactory]") {
|
||||
INFO("PlacementFactory Tests");
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "LocalPoolOwnerBase.h"
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
#include "tests/TestsConfig.h"
|
||||
|
||||
TEST_CASE("DataSetTest", "[DataSetTest]") {
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "LocalPoolOwnerBase.h"
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("LocalPoolManagerTest", "[LocManTest]") {
|
||||
LocalPoolOwnerBase* poolOwner =
|
||||
|
@ -4,11 +4,11 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "LocalPoolOwnerBase.h"
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
#include "tests/TestsConfig.h"
|
||||
|
||||
TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") {
|
||||
LocalPoolOwnerBase* poolOwner =
|
||||
auto* poolOwner =
|
||||
ObjectManager::instance()->get<LocalPoolOwnerBase>(objects::TEST_LOCAL_POOL_OWNER_BASE);
|
||||
REQUIRE(poolOwner != nullptr);
|
||||
REQUIRE(poolOwner->initializeHkManager() == retval::CATCH_OK);
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "LocalPoolOwnerBase.h"
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
#include "tests/TestsConfig.h"
|
||||
|
||||
TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") {
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "DeviceFdirMock.h"
|
||||
|
||||
#include <tests/src/fsfw_tests/unit/devicehandler/DeviceFdirMock.h>
|
||||
#include "devicehandler/DeviceFdirMock.h"
|
||||
|
||||
DeviceFdirMock::DeviceFdirMock(object_id_t owner, object_id_t parent)
|
||||
: DeviceHandlerFailureIsolation(owner, parent) {}
|
||||
|
@ -2,14 +2,14 @@
|
||||
|
||||
#include "ComIFMock.h"
|
||||
#include "DeviceFdirMock.h"
|
||||
#include "fsfw_tests/unit/devicehandler/CookieIFMock.h"
|
||||
#include "fsfw_tests/unit/devicehandler/DeviceHandlerCommander.h"
|
||||
#include "fsfw_tests/unit/devicehandler/DeviceHandlerMock.h"
|
||||
#include "fsfw_tests/unit/testcfg/objects/systemObjectList.h"
|
||||
#include "devicehandler/CookieIFMock.h"
|
||||
#include "DeviceHandlerCommander.h"
|
||||
#include "DeviceHandlerMock.h"
|
||||
#include "objects/systemObjectList.h"
|
||||
|
||||
TEST_CASE("Device Handler Base", "[DeviceHandlerBase]") {
|
||||
// Will be deleted with DHB destructor
|
||||
CookieIFMock* cookieIFMock = new CookieIFMock;
|
||||
auto* cookieIFMock = new CookieIFMock;
|
||||
ComIFMock comIF(objects::COM_IF_MOCK);
|
||||
DeviceFdirMock deviceFdirMock(objects::DEVICE_HANDLER_MOCK, objects::NO_OBJECT);
|
||||
DeviceHandlerMock deviceHandlerMock(objects::DEVICE_HANDLER_MOCK, objects::COM_IF_MOCK,
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "catch2/catch_test_macros.hpp"
|
||||
#include "fsfw/globalfunctions/CRC.h"
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("CRC", "[CRC]") {
|
||||
std::array<uint8_t, 10> testData = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "catch2/catch_test_macros.hpp"
|
||||
#include "fsfw/globalfunctions/DleEncoder.h"
|
||||
#include "fsfw_tests/unit/CatchDefinitions.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};
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <catch2/catch_approx.hpp>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("TimevalTest", "[timevalOperations]") {
|
||||
SECTION("Comparison") {
|
||||
|
@ -12,8 +12,8 @@
|
||||
#include "fsfw/ipc/CommandMessage.h"
|
||||
#include "fsfw/ipc/MessageQueueMessage.h"
|
||||
#include "fsfw/objectmanager/frameworkObjects.h"
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "fsfw_tests/unit/mocks/PeriodicTaskIFMock.h"
|
||||
#include "CatchDefinitions.h"
|
||||
#include "mocks/PeriodicTaskIFMock.h"
|
||||
|
||||
TEST_CASE("Internal Error Reporter", "[TestInternalError]") {
|
||||
PeriodicTaskMock task(10, nullptr);
|
||||
@ -21,7 +21,7 @@ TEST_CASE("Internal Error Reporter", "[TestInternalError]") {
|
||||
if (manager == nullptr) {
|
||||
FAIL();
|
||||
}
|
||||
InternalErrorReporter* internalErrorReporter = dynamic_cast<InternalErrorReporter*>(
|
||||
auto* internalErrorReporter = dynamic_cast<InternalErrorReporter*>(
|
||||
ObjectManager::instance()->get<InternalErrorReporterIF>(objects::INTERNAL_ERROR_REPORTER));
|
||||
if (internalErrorReporter == nullptr) {
|
||||
FAIL();
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "fsfw/ipc/MessageQueueBase.h"
|
||||
#include "fsfw/ipc/MessageQueueIF.h"
|
||||
#include "fsfw/ipc/MessageQueueMessage.h"
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
class MessageQueueMockBase : public MessageQueueBase {
|
||||
public:
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <catch2/catch_approx.hpp>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("OSAL::Clock Test", "[OSAL::Clock Test]") {
|
||||
SECTION("Test getClock") {
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <array>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("MessageQueue Basic Test", "[TestMq]") {
|
||||
MessageQueueIF* testSenderMq = QueueFactory::instance()->createMessageQueue(1);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <fsfw/power/DummyPowerSwitcher.h>
|
||||
#include <fsfw/power/PowerSwitcher.h>
|
||||
#include <fsfw_tests/unit/mocks/PowerSwitcherMock.h>
|
||||
#include "mocks/PowerSwitcherMock.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <array>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
static bool test_value_bool = true;
|
||||
static uint16_t tv_uint16{283};
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <array>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("Serial Linked Packet", "[SerLinkPacket]") {
|
||||
// perform set-up here
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <catch2/catch_approx.hpp>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
static bool testBool = true;
|
||||
static uint8_t tvUint8{5};
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <cstring>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("New Accessor", "[NewAccessor]") {
|
||||
LocalPool::LocalPoolConfig poolCfg = {{1, 10}};
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <cstring>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") {
|
||||
LocalPool::LocalPoolConfig config = {{1, 10}};
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw/serviceinterface.h"
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("Version API Tests", "[TestVersionAPI]") {
|
||||
// Check that major version is non-zero
|
||||
|
@ -5,11 +5,11 @@
|
||||
#include <catch2/catch_approx.hpp>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") {
|
||||
INFO("CCSDSTime Tests");
|
||||
CCSDSTime::Ccs_mseconds cssMilliSecconds;
|
||||
CCSDSTime::Ccs_mseconds cssMilliSecconds{};
|
||||
Clock::TimeOfDay_t time;
|
||||
time.year = 2020;
|
||||
time.month = 2;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("Countdown Tests", "[TestCountdown]") {
|
||||
INFO("Countdown Tests");
|
||||
|
Loading…
Reference in New Issue
Block a user