1
0
forked from fsfw/fsfw

test update

This commit is contained in:
2021-01-06 19:32:33 +01:00
parent 8807772d13
commit db7d28f852
12 changed files with 164 additions and 31 deletions

View File

@ -5,3 +5,9 @@ target_sources(${TARGET_NAME} PRIVATE
CatchSetup.cpp
printChar.cpp
)
if(CUSTOM_UNITTEST_RUNNER)
target_sources(${TARGET_NAME} PRIVATE
CatchRunner.cpp
)
endif()

View File

@ -1,4 +1,5 @@
#include "CatchDefinitions.h"
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw/objectmanager/ObjectManagerIF.h>
StorageManagerIF* tglob::getIpcStoreHandle() {
@ -7,6 +8,8 @@ StorageManagerIF* tglob::getIpcStoreHandle() {
} else {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "Global object manager uninitialized" << std::endl;
#else
fsfw::printError("Global object manager uninitialized");
#endif
return nullptr;
}

View File

@ -1,11 +1,15 @@
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#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>
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
#include <fsfw/tmtcservices/CommandingServiceBase.h>
#include <fsfw/tmtcservices/PusServiceBase.h>
/**
* @brief Produces system objects.
@ -50,7 +54,23 @@ void Factory::produce(void) {
}
void Factory::setStaticFrameworkObjectIds() {
PusServiceBase::packetSource = objects::NO_OBJECT;
PusServiceBase::packetDestination = objects::NO_OBJECT;
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS;
LocalDataPoolManager::defaultHkDestination = objects::NO_OBJECT;
DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT;
TmPacketStored::timeStamperId = objects::NO_OBJECT;
}

View File

@ -1,17 +1,16 @@
/**
* @file CatchSource.cpp
* @file CatchRunner.cpp
* @brief Source file to compile catch framework.
* @details All tests should be written in other files.
* For eclipse console output, install ANSI Escape in Console
* from the eclipse market place to get colored characters.
*/
#ifndef NO_UNIT_TEST_FRAMEWORK
#include <TestsConfig.h>
#define CATCH_CONFIG_RUNNER
#include <catch2/catch.hpp>
#define CATCH_CONFIG_COLOUR_WINDOWS
#if CUSTOM_UNITTEST_RUNNER == 0
#include <catch2/catch_session.hpp>
extern int customSetup();
@ -25,7 +24,3 @@ int main( int argc, char* argv[] ) {
return result;
}
#endif
#endif

View File

@ -1,21 +1,20 @@
#include <fsfw/unittest/core/CatchFactory.h>
#include "CatchFactory.h"
#include "CatchDefinitions.h"
#include <testcfg/cdatapool/dataPoolInit.h>
#ifdef GCOV
#include <gcov.h>
#endif
#include "../../objectmanager/ObjectManager.h"
#include "../../objectmanager/ObjectManagerIF.h"
#include "../../storagemanager/StorageManagerIF.h"
#include "../../serviceinterface/ServiceInterfaceStream.h"
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/objectmanager/ObjectManagerIF.h>
#include <fsfw/storagemanager/StorageManagerIF.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
/* Global instantiations normally done in main.cpp */
/* Initialize Data Pool */
#if FSFW_CPP_OSTREAM_ENABLED == 1
namespace sif {
/* Set up output streams */
ServiceInterfaceStream debug("DEBUG");
@ -23,6 +22,7 @@ ServiceInterfaceStream info("INFO");
ServiceInterfaceStream error("ERROR");
ServiceInterfaceStream warning("WARNING");
}
#endif
/* Global object manager */
ObjectManagerIF *objectManager;

View File

@ -1,4 +1,4 @@
#include <fsfw/unittest/core/printChar.h>
#include "printChar.h"
#include <cstdio>
void printChar(const char* character, bool errStream) {