updated internal unit test

This commit is contained in:
Robin Müller 2021-01-15 16:56:36 +01:00
parent baba8fa5d7
commit 73b9d058e5
5 changed files with 31 additions and 7 deletions

View File

@ -5,24 +5,37 @@
#include "osal/IntTestSemaphore.h"
#include "osal/IntTestMutex.h"
#include "serialize/IntTestSerialization.h"
#include "globalfunctions/TestArrayPrinter.h"
#include <cstdlib>
struct TestConfig {
bool testArrayPrinter;
};
InternalUnitTester::InternalUnitTester() {}
InternalUnitTester::~InternalUnitTester() {}
ReturnValue_t InternalUnitTester::performTests() {
ReturnValue_t InternalUnitTester::performTests(struct TestConfig testConfig) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Running internal unit tests.." << std::endl;
#else
sif::printInfo("Running internal unit tests..\n");
#endif
testserialize::test_serialization();
testmq::testMq();
testsemaph::testBinSemaph();
testsemaph::testCountingSemaph();
testmutex::testMutex();
if(testConfig.testArrayPrinter) {
arrayprinter::testArrayPrinter();
}
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Internal unit tests finished." << std::endl;
#else
sif::printInfo("Running internal unit tests..\n");
#endif
return RETURN_OK;
}

View File

@ -22,7 +22,7 @@ public:
* Some function which calls all other tests
* @return
*/
virtual ReturnValue_t performTests();
virtual ReturnValue_t performTests(struct TestConfig testConfig);
};

View File

@ -0,0 +1,4 @@
#include "TestArrayPrinter.cpp"
void arrayprinter::testArrayPrinter() {
}

View File

@ -0,0 +1,12 @@
#ifndef FSFW_UNITTEST_INTERNAL_GLOBALFUNCTIONS_TESTARRAYPRINTER_H_
#define FSFW_UNITTEST_INTERNAL_GLOBALFUNCTIONS_TESTARRAYPRINTER_H_
namespace arrayprinter {
void testArrayPrinter();
}
#endif /* FSFW_UNITTEST_INTERNAL_GLOBALFUNCTIONS_TESTARRAYPRINTER_H_ */

View File

@ -1,5 +0,0 @@
#include <catch2/catch_test_macros.hpp>