2021-08-02 20:58:56 +02:00
|
|
|
#include "fsfw_tests/internal/InternalUnitTester.h"
|
|
|
|
#include "fsfw_tests/internal/UnittDefinitions.h"
|
|
|
|
|
|
|
|
#include "fsfw_tests/internal/osal/IntTestMq.h"
|
|
|
|
#include "fsfw_tests/internal/osal/IntTestSemaphore.h"
|
|
|
|
#include "fsfw_tests/internal/osal/IntTestMutex.h"
|
|
|
|
#include "fsfw_tests/internal/serialize/IntTestSerialization.h"
|
|
|
|
#include "fsfw_tests/internal/globalfunctions/TestArrayPrinter.h"
|
2020-10-20 17:11:23 +02:00
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
|
|
|
InternalUnitTester::InternalUnitTester() {}
|
|
|
|
|
|
|
|
InternalUnitTester::~InternalUnitTester() {}
|
|
|
|
|
2021-07-14 10:22:58 +02:00
|
|
|
ReturnValue_t InternalUnitTester::performTests(
|
|
|
|
const struct InternalUnitTester::TestConfig& testConfig) {
|
2021-01-03 14:16:52 +01:00
|
|
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
2021-08-16 11:27:46 +02:00
|
|
|
sif::info << "Running internal unit tests.. Error messages might follow" <<
|
|
|
|
std::endl;
|
2021-01-15 16:56:36 +01:00
|
|
|
#else
|
|
|
|
sif::printInfo("Running internal unit tests..\n");
|
2021-01-03 13:58:18 +01:00
|
|
|
#endif
|
2021-01-15 16:56:36 +01:00
|
|
|
|
2020-10-20 17:11:23 +02:00
|
|
|
testserialize::test_serialization();
|
|
|
|
testmq::testMq();
|
2021-08-16 11:27:46 +02:00
|
|
|
if(testConfig.testSemaphores) {
|
|
|
|
testsemaph::testBinSemaph();
|
|
|
|
testsemaph::testCountingSemaph();
|
|
|
|
}
|
2020-10-20 17:11:23 +02:00
|
|
|
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
|
2021-01-15 18:07:32 +01:00
|
|
|
sif::printInfo("Internal unit tests finished.\n");
|
2021-01-03 13:58:18 +01:00
|
|
|
#endif
|
2020-10-20 17:11:23 +02:00
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|