fsfw/unittest/internal/InternalUnitTester.cpp

45 lines
1.0 KiB
C++
Raw Normal View History

2020-10-29 17:22:41 +01:00
#include "InternalUnitTester.h"
#include "UnittDefinitions.h"
#include "osal/IntTestMq.h"
#include "osal/IntTestSemaphore.h"
#include "osal/IntTestMutex.h"
#include "serialize/IntTestSerialization.h"
2021-01-15 16:56:36 +01:00
#include "globalfunctions/TestArrayPrinter.h"
2020-10-20 17:11:23 +02:00
#include <cstdlib>
2021-01-15 16:56:36 +01:00
struct TestConfig {
bool testArrayPrinter;
};
2020-10-20 17:11:23 +02:00
InternalUnitTester::InternalUnitTester() {}
InternalUnitTester::~InternalUnitTester() {}
2021-01-15 16:56:36 +01:00
ReturnValue_t InternalUnitTester::performTests(struct TestConfig testConfig) {
2021-01-03 14:16:52 +01:00
#if FSFW_CPP_OSTREAM_ENABLED == 1
2020-10-29 12:23:27 +01:00
sif::info << "Running internal unit tests.." << std::endl;
2021-01-15 16:56:36 +01:00
#else
sif::printInfo("Running internal unit tests..\n");
#endif
2021-01-15 16:56:36 +01:00
2020-10-20 17:11:23 +02:00
testserialize::test_serialization();
testmq::testMq();
testsemaph::testBinSemaph();
testsemaph::testCountingSemaph();
testmutex::testMutex();
2021-01-15 16:56:36 +01:00
if(testConfig.testArrayPrinter) {
arrayprinter::testArrayPrinter();
}
2021-01-03 14:16:52 +01:00
#if FSFW_CPP_OSTREAM_ENABLED == 1
2020-10-29 12:23:27 +01:00
sif::info << "Internal unit tests finished." << std::endl;
2021-01-15 16:56:36 +01:00
#else
sif::printInfo("Running internal unit tests..\n");
#endif
2020-10-20 17:11:23 +02:00
return RETURN_OK;
}