some refactoring

This commit is contained in:
Robin Müller 2022-05-08 02:11:57 +02:00
parent 6984404979
commit ca501272d8
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
7 changed files with 18 additions and 9 deletions

View File

@ -1,6 +1,5 @@
add_subdirectory(config) add_subdirectory(config)
add_subdirectory(example) add_subdirectory(example)
add_subdirectory(test)
target_include_directories(${TARGET_NAME} PRIVATE target_include_directories(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -4,7 +4,9 @@
#ifndef COMMON_COMMONCONFIG_H_ #ifndef COMMON_COMMONCONFIG_H_
#define COMMON_COMMONCONFIG_H_ #define COMMON_COMMONCONFIG_H_
#include <stdint.h> #include <cstdint>
#cmakedefine01 FSFW_ADD_FMT_TESTS
//! Specify the debug output verbose level //! Specify the debug output verbose level
#define OBSW_VERBOSE_LEVEL 1 #define OBSW_VERBOSE_LEVEL 1

View File

@ -4,3 +4,9 @@ target_sources(${TARGET_NAME} PRIVATE
MutexExample.cpp MutexExample.cpp
FsfwTestTask.cpp FsfwTestTask.cpp
) )
if(FSFW_ADD_FMT_TESTS)
target_sources(${TARGET_NAME} PRIVATE
testFmt.cpp
)
endif()

View File

@ -1,9 +1,16 @@
#include "FsfwTestTask.h" #include "FsfwTestTask.h"
#include "../test/testFmt.h"
#include <commonConfig.h>
#if FSFW_ADD_FMT_TESTS == 1
#include "testFmt.h"
#endif
FsfwTestTask::FsfwTestTask(object_id_t objectId, bool periodicEvent) FsfwTestTask::FsfwTestTask(object_id_t objectId, bool periodicEvent)
: TestTask(objectId), periodicEvent(periodicEvent) { : TestTask(objectId), periodicEvent(periodicEvent) {
#if FSFW_ADD_FMT_TESTS == 1
fmtTests(); fmtTests();
#endif
} }
ReturnValue_t FsfwTestTask::performPeriodicAction() { ReturnValue_t FsfwTestTask::performPeriodicAction() {

View File

@ -1,5 +0,0 @@
if(FSFW_ADD_FMT_TESTS)
target_sources(${TARGET_NAME} PRIVATE
testFmt.cpp
)
endif()