Merge pull request 'unittest update' (#323) from KSat/fsfw:mueller/unittest-update into development
Reviewed-on: fsfw/fsfw#323
This commit is contained in:
commit
4a154140f3
56
unittest/core/CatchFactory.cpp
Normal file
56
unittest/core/CatchFactory.cpp
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#include "CatchFactory.h"
|
||||||
|
|
||||||
|
#include <fsfw/events/EventManager.h>
|
||||||
|
#include <fsfw/health/HealthTable.h>
|
||||||
|
|
||||||
|
#include <fsfw/internalError/InternalErrorReporter.h>
|
||||||
|
#include <fsfw/objectmanager/frameworkObjects.h>
|
||||||
|
#include <fsfw/storagemanager/PoolManager.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Produces system objects.
|
||||||
|
* @details
|
||||||
|
* Build tasks by using SystemObject Interface (Interface).
|
||||||
|
* Header files of all tasks must be included
|
||||||
|
* Please note that an object has to implement the system object interface
|
||||||
|
* if the interface validity is checked or retrieved later by using the
|
||||||
|
* get<TargetInterface>(object_id) function from the ObjectManagerIF.
|
||||||
|
*
|
||||||
|
* Framework objects are created first.
|
||||||
|
*
|
||||||
|
* @ingroup init
|
||||||
|
*/
|
||||||
|
void Factory::produce(void) {
|
||||||
|
setStaticFrameworkObjectIds();
|
||||||
|
new EventManager(objects::EVENT_MANAGER);
|
||||||
|
new HealthTable(objects::HEALTH_TABLE);
|
||||||
|
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
|
||||||
|
|
||||||
|
{
|
||||||
|
PoolManager::LocalPoolConfig poolCfg = {
|
||||||
|
{100, 16}, {50, 32}, {25, 64} , {15, 128}, {5, 1024}
|
||||||
|
};
|
||||||
|
new PoolManager(objects::TC_STORE, poolCfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
PoolManager::LocalPoolConfig poolCfg = {
|
||||||
|
{100, 16}, {50, 32}, {25, 64} , {15, 128}, {5, 1024}
|
||||||
|
};
|
||||||
|
new PoolManager(objects::TM_STORE, poolCfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
PoolManager::LocalPoolConfig poolCfg = {
|
||||||
|
{100, 16}, {50, 32}, {25, 64} , {15, 128}, {5, 1024}
|
||||||
|
};
|
||||||
|
new PoolManager(objects::IPC_STORE, poolCfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Factory::setStaticFrameworkObjectIds() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef FACTORY_H_
|
#ifndef FSFW_CATCHFACTORY_H_
|
||||||
#define FACTORY_H_
|
#define FSFW_CATCHFACTORY_H_
|
||||||
|
|
||||||
#include <fsfw/objectmanager/SystemObjectIF.h>
|
#include <fsfw/objectmanager/SystemObjectIF.h>
|
||||||
|
|
||||||
@ -13,4 +13,4 @@ namespace Factory {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FACTORY_H_ */
|
#endif /* FSFW_CATCHFACTORY_H_ */
|
@ -1,6 +1,5 @@
|
|||||||
|
#include <fsfw/unittest/core/CatchFactory.h>
|
||||||
#include "CatchDefinitions.h"
|
#include "CatchDefinitions.h"
|
||||||
#include "CatchFactory.h"
|
|
||||||
|
|
||||||
#include <testcfg/cdatapool/dataPoolInit.h>
|
#include <testcfg/cdatapool/dataPoolInit.h>
|
||||||
|
|
||||||
#ifdef GCOV
|
#ifdef GCOV
|
||||||
@ -10,15 +9,11 @@
|
|||||||
#include "../../objectmanager/ObjectManager.h"
|
#include "../../objectmanager/ObjectManager.h"
|
||||||
#include "../../objectmanager/ObjectManagerIF.h"
|
#include "../../objectmanager/ObjectManagerIF.h"
|
||||||
#include "../../storagemanager/StorageManagerIF.h"
|
#include "../../storagemanager/StorageManagerIF.h"
|
||||||
#include "../../datapool/DataPool.h"
|
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
|
|
||||||
|
|
||||||
/* Global instantiations normally done in main.cpp */
|
/* Global instantiations normally done in main.cpp */
|
||||||
/* Initialize Data Pool */
|
/* Initialize Data Pool */
|
||||||
//namespace glob {
|
|
||||||
DataPool dataPool(datapool::dataPoolInit);
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
namespace sif {
|
namespace sif {
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
#include "CatchFactory.h"
|
|
||||||
|
|
||||||
#include <fsfw/events/EventManager.h>
|
|
||||||
#include <fsfw/health/HealthTable.h>
|
|
||||||
|
|
||||||
#include <fsfw/internalError/InternalErrorReporter.h>
|
|
||||||
#include <fsfw/objectmanager/frameworkObjects.h>
|
|
||||||
#include <fsfw/storagemanager/PoolManager.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Produces system objects.
|
|
||||||
* @details
|
|
||||||
* Build tasks by using SystemObject Interface (Interface).
|
|
||||||
* Header files of all tasks must be included
|
|
||||||
* Please note that an object has to implement the system object interface
|
|
||||||
* if the interface validity is checked or retrieved later by using the
|
|
||||||
* get<TargetInterface>(object_id) function from the ObjectManagerIF.
|
|
||||||
*
|
|
||||||
* Framework objects are created first.
|
|
||||||
*
|
|
||||||
* @ingroup init
|
|
||||||
*/
|
|
||||||
void Factory::produce(void) {
|
|
||||||
setStaticFrameworkObjectIds();
|
|
||||||
new EventManager(objects::EVENT_MANAGER);
|
|
||||||
new HealthTable(objects::HEALTH_TABLE);
|
|
||||||
//new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
|
|
||||||
|
|
||||||
{
|
|
||||||
static constexpr uint8_t NUMBER_OF_POOLS = 5;
|
|
||||||
const uint16_t element_sizes[NUMBER_OF_POOLS] = {16, 32, 64, 128, 1024};
|
|
||||||
const uint16_t n_elements[NUMBER_OF_POOLS] = {100, 50, 25, 15, 5};
|
|
||||||
new PoolManager<NUMBER_OF_POOLS>(objects::TC_STORE, element_sizes,
|
|
||||||
n_elements);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
static constexpr uint8_t NUMBER_OF_POOLS = 5;
|
|
||||||
const uint16_t element_sizes[NUMBER_OF_POOLS] = {16, 32, 64, 128, 1024};
|
|
||||||
const uint16_t n_elements[NUMBER_OF_POOLS] = {100, 50, 25, 15, 5};
|
|
||||||
new PoolManager<NUMBER_OF_POOLS>(objects::TM_STORE, element_sizes,
|
|
||||||
n_elements);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
static constexpr uint8_t NUMBER_OF_POOLS = 6;
|
|
||||||
const uint16_t element_sizes[NUMBER_OF_POOLS] = {32, 64, 512,
|
|
||||||
1024, 2048, 4096};
|
|
||||||
const uint16_t n_elements[NUMBER_OF_POOLS] = {200, 100, 50, 25, 15, 5};
|
|
||||||
new PoolManager<NUMBER_OF_POOLS>(objects::IPC_STORE, element_sizes,
|
|
||||||
n_elements);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Factory::setStaticFrameworkObjectIds() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,44 +1,55 @@
|
|||||||
#ifndef CONFIG_FSFWCONFIG_H_
|
#ifndef CONFIG_FSFWCONFIG_H_
|
||||||
#define CONFIG_FSFWCONFIG_H_
|
#define CONFIG_FSFWCONFIG_H_
|
||||||
|
|
||||||
#include <FSFWVersion.h>
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
//! Used to determine whether C++ ostreams are used
|
//! Used to determine whether C++ ostreams are used
|
||||||
//! Those can lead to code bloat.
|
//! Those can lead to code bloat.
|
||||||
#define FSFW_CPP_OSTREAM_ENABLED 1
|
#define FSFW_CPP_OSTREAM_ENABLED 1
|
||||||
|
|
||||||
//! Reduced printout to further decrese code size
|
//! Reduced printout to further decrease code size
|
||||||
//! Be careful, this also turns off most diagnostic prinouts!
|
//! Be careful, this also turns off most diagnostic prinouts!
|
||||||
#define FSFW_REDUCED_PRINTOUT 0
|
#define FSFW_ENHANCED_PRINTOUT 0
|
||||||
|
|
||||||
//! Can be used to enable debugging printouts for developing the FSFW
|
//! Can be used to enable additional debugging printouts for developing the FSFW
|
||||||
#define FSFW_DEBUGGING 0
|
#define FSFW_PRINT_VERBOSITY_LEVEL 0
|
||||||
|
|
||||||
//! Defines the FIFO depth of each commanding service base which
|
|
||||||
//! also determines how many commands a CSB service can handle in one cycle
|
|
||||||
//! simulataneously. This will increase the required RAM for
|
|
||||||
//! each CSB service !
|
|
||||||
#define FSFW_CSB_FIFO_DEPTH 6
|
|
||||||
|
|
||||||
//! If FSFW_OBJ_EVENT_TRANSLATION is set to one,
|
//! If FSFW_OBJ_EVENT_TRANSLATION is set to one,
|
||||||
//! additional output which requires the translation files translateObjects
|
//! additional output which requires the translation files translateObjects
|
||||||
//! and translateEvents (and their compiled source files)
|
//! and translateEvents (and their compiled source files)
|
||||||
#define FSFW_OBJ_EVENT_TRANSLATION 0
|
#define FSFW_OBJ_EVENT_TRANSLATION 0
|
||||||
|
|
||||||
//! If -DDEBUG is supplied in the build defines, there will be
|
|
||||||
//! additional output which requires the translation files translateObjects
|
|
||||||
//! and translateEvents (and their compiles source files)
|
|
||||||
#if FSFW_OBJ_EVENT_TRANSLATION == 1
|
#if FSFW_OBJ_EVENT_TRANSLATION == 1
|
||||||
//! Specify whether info events are printed too.
|
//! Specify whether info events are printed too.
|
||||||
#define FSFW_DEBUG_INFO 1
|
#define FSFW_DEBUG_INFO 1
|
||||||
#include <translateObjects.h>
|
#include "objects/translateObjects.h"
|
||||||
#include <translateEvents.h>
|
#include "events/translateEvents.h"
|
||||||
#else
|
#else
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! When using the newlib nano library, C99 support for stdio facilities
|
//! When using the newlib nano library, C99 support for stdio facilities
|
||||||
//! will not be provided. This define should be set to 1 if this is the case.
|
//! will not be provided. This define should be set to 1 if this is the case.
|
||||||
#define FSFW_NO_C99_IO 1
|
#define FSFW_NO_C99_IO 1
|
||||||
|
|
||||||
|
//! Specify whether a special mode store is used for Subsystem components.
|
||||||
|
#define FSFW_USE_MODESTORE 0
|
||||||
|
|
||||||
|
namespace fsfwconfig {
|
||||||
|
//! Default timestamp size. The default timestamp will be an eight byte CDC
|
||||||
|
//! short timestamp.
|
||||||
|
static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 8;
|
||||||
|
|
||||||
|
//! Configure the allocated pool sizes for the event manager.
|
||||||
|
static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240;
|
||||||
|
static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120;
|
||||||
|
static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120;
|
||||||
|
|
||||||
|
//! Defines the FIFO depth of each commanding service base which
|
||||||
|
//! also determines how many commands a CSB service can handle in one cycle
|
||||||
|
//! simulataneously. This will increase the required RAM for
|
||||||
|
//! each CSB service !
|
||||||
|
static constexpr uint8_t FSFW_CSB_FIFO_DEPTH = 3;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_FSFWCONFIG_H_ */
|
#endif /* CONFIG_FSFWCONFIG_H_ */
|
||||||
|
@ -15,7 +15,7 @@ SHELL = /bin/sh
|
|||||||
# (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
|
# (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
|
||||||
# Unit Test can only be run on host machine for now (Linux)
|
# Unit Test can only be run on host machine for now (Linux)
|
||||||
FRAMEWORK_PATH = fsfw
|
FRAMEWORK_PATH = fsfw
|
||||||
FILE_ROOT = $(FRAMEWORK_PATH)/unittest
|
TEST_FILE_ROOT = $(FRAMEWORK_PATH)/unittest
|
||||||
BOARD = unittest
|
BOARD = unittest
|
||||||
LINUX = 1
|
LINUX = 1
|
||||||
OS_FSFW = linux
|
OS_FSFW = linux
|
||||||
@ -58,9 +58,10 @@ endif
|
|||||||
|
|
||||||
UNIT_TEST = 1
|
UNIT_TEST = 1
|
||||||
# General folder paths
|
# General folder paths
|
||||||
CONFIG_PATH = $(FILE_ROOT)/config
|
CONFIG_PATH = testcfg
|
||||||
UNIT_TEST_PATH = $(FILE_ROOT)/tests
|
# Core copy has to be copied as well.
|
||||||
CORE_PATH = $(FILE_ROOT)/core
|
CORE_PATH = core
|
||||||
|
UNIT_TEST_PATH = $(TEST_FILE_ROOT)/tests
|
||||||
|
|
||||||
# Output file basename
|
# Output file basename
|
||||||
BASENAME = fsfw
|
BASENAME = fsfw
|
||||||
@ -154,8 +155,8 @@ include $(S)/$(notdir $S).mk
|
|||||||
endef
|
endef
|
||||||
$(foreach S,$(SUBDIRS),$(eval $(INCLUDE_FILE)))
|
$(foreach S,$(SUBDIRS),$(eval $(INCLUDE_FILE)))
|
||||||
|
|
||||||
INCLUDES += $(FILE_ROOT)
|
INCLUDES += $(TEST_FILE_ROOT)
|
||||||
INCLUDES += $(FILE_ROOT)/catch2/
|
INCLUDES += $(TEST_FILE_ROOT)/catch2/
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Source Files
|
# Source Files
|
||||||
|
@ -6,11 +6,3 @@ CXXSRC += $(wildcard $(CURRENTPATH)/events/*.cpp)
|
|||||||
CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp)
|
CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp)
|
||||||
|
|
||||||
INCLUDES += $(CURRENTPATH)
|
INCLUDES += $(CURRENTPATH)
|
||||||
INCLUDES += $(CURRENTPATH)/objects
|
|
||||||
INCLUDES += $(CURRENTPATH)/ipc
|
|
||||||
INCLUDES += $(CURRENTPATH)/pollingsequence
|
|
||||||
INCLUDES += $(CURRENTPATH)/returnvalues
|
|
||||||
INCLUDES += $(CURRENTPATH)/tmtc
|
|
||||||
INCLUDES += $(CURRENTPATH)/events
|
|
||||||
INCLUDES += $(CURRENTPATH)/devices
|
|
||||||
INCLUDES += $(CURRENTPATH)/cdatapool
|
|
||||||
|
Loading…
Reference in New Issue
Block a user