trying to fuse header / inc
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
if(FSFW_ADD_INTERNAL_TESTS)
|
||||
add_subdirectory(internal)
|
||||
endif()
|
||||
target_include_directories(${LIB_FSFW_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
if(FSFW_ADD_UNITTESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_subdirectory(fsfw)
|
||||
|
1
tests/src/fsfw/CMakeLists.txt
Normal file
1
tests/src/fsfw/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
add_subdirectory(tests)
|
8
tests/src/fsfw/tests/CMakeLists.txt
Normal file
8
tests/src/fsfw/tests/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
if(FSFW_ADD_INTERNAL_TESTS)
|
||||
add_subdirectory(internal)
|
||||
endif()
|
||||
|
||||
if(FSFW_ADD_UNITTESTS)
|
||||
add_subdirectory(unit)
|
||||
endif()
|
34
tests/src/fsfw/tests/internal/InternalUnitTester.h
Normal file
34
tests/src/fsfw/tests/internal/InternalUnitTester.h
Normal file
@ -0,0 +1,34 @@
|
||||
#ifndef FRAMEWORK_TEST_UNITTESTCLASS_H_
|
||||
#define FRAMEWORK_TEST_UNITTESTCLASS_H_
|
||||
|
||||
#include "UnittDefinitions.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Can be used for internal testing, for example for hardware specific
|
||||
* tests which can not be run on a host-machine.
|
||||
*
|
||||
* TODO: A lot of ways to improve this class. A way for tests to subscribe
|
||||
* in this central class would be nice. Right now, this is the class
|
||||
* which simply calls all other tests from other files manually.
|
||||
* Maybe there is a better way..
|
||||
*/
|
||||
class InternalUnitTester: public HasReturnvaluesIF {
|
||||
public:
|
||||
struct TestConfig {
|
||||
bool testArrayPrinter = false;
|
||||
};
|
||||
|
||||
InternalUnitTester();
|
||||
virtual~ InternalUnitTester();
|
||||
|
||||
/**
|
||||
* Some function which calls all other tests
|
||||
* @return
|
||||
*/
|
||||
virtual ReturnValue_t performTests(const struct InternalUnitTester::TestConfig& testConfig);
|
||||
};
|
||||
|
||||
|
||||
#endif /* FRAMEWORK_TEST_UNITTESTCLASS_H_ */
|
35
tests/src/fsfw/tests/internal/UnittDefinitions.h
Normal file
35
tests/src/fsfw/tests/internal/UnittDefinitions.h
Normal file
@ -0,0 +1,35 @@
|
||||
#ifndef UNITTEST_INTERNAL_UNITTDEFINITIONS_H_
|
||||
#define UNITTEST_INTERNAL_UNITTDEFINITIONS_H_
|
||||
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
namespace tv {
|
||||
// POD test values
|
||||
static const bool tv_bool = true;
|
||||
static const uint8_t tv_uint8 {5};
|
||||
static const uint16_t tv_uint16 {283};
|
||||
static const uint32_t tv_uint32 {929221};
|
||||
static const uint64_t tv_uint64 {2929329429};
|
||||
|
||||
static const int8_t tv_int8 {-16};
|
||||
static const int16_t tv_int16 {-829};
|
||||
static const int32_t tv_int32 {-2312};
|
||||
|
||||
static const float tv_float {8.2149214};
|
||||
static const float tv_sfloat = {-922.2321321};
|
||||
static const double tv_double {9.2132142141e8};
|
||||
static const double tv_sdouble {-2.2421e19};
|
||||
}
|
||||
|
||||
namespace unitt {
|
||||
ReturnValue_t put_error(std::string errorId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* UNITTEST_INTERNAL_UNITTDEFINITIONS_H_ */
|
@ -0,0 +1,13 @@
|
||||
#ifndef FSFW_UNITTEST_INTERNAL_GLOBALFUNCTIONS_TESTARRAYPRINTER_H_
|
||||
#define FSFW_UNITTEST_INTERNAL_GLOBALFUNCTIONS_TESTARRAYPRINTER_H_
|
||||
|
||||
#include <fsfw/globalfunctions/arrayprinter.h>
|
||||
#include <array>
|
||||
|
||||
namespace arrayprinter {
|
||||
|
||||
void testArrayPrinter();
|
||||
|
||||
}
|
||||
|
||||
#endif /* FSFW_UNITTEST_INTERNAL_GLOBALFUNCTIONS_TESTARRAYPRINTER_H_ */
|
9
tests/src/fsfw/tests/internal/osal/IntTestMq.h
Normal file
9
tests/src/fsfw/tests/internal/osal/IntTestMq.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef UNITTEST_INTERNAL_INTESTMQ_H_
|
||||
#define UNITTEST_INTERNAL_INTESTMQ_H_
|
||||
|
||||
namespace testmq {
|
||||
void testMq();
|
||||
}
|
||||
|
||||
|
||||
#endif /* UNITTEST_INTERNAL_INTESTMQ_H_ */
|
10
tests/src/fsfw/tests/internal/osal/IntTestMutex.h
Normal file
10
tests/src/fsfw/tests/internal/osal/IntTestMutex.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef UNITTEST_INTERNAL_INTTESTMUTEX_H_
|
||||
#define UNITTEST_INTERNAL_INTTESTMUTEX_H_
|
||||
|
||||
namespace testmutex {
|
||||
void testMutex();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* UNITTEST_INTERNAL_INTTESTMUTEX_H_ */
|
15
tests/src/fsfw/tests/internal/osal/IntTestSemaphore.h
Normal file
15
tests/src/fsfw/tests/internal/osal/IntTestSemaphore.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef UNITTEST_INTERNAL_INTTESTSEMAPHORE_H_
|
||||
#define UNITTEST_INTERNAL_INTTESTSEMAPHORE_H_
|
||||
class SemaphoreIF;
|
||||
#include <string>
|
||||
|
||||
namespace testsemaph {
|
||||
void testBinSemaph();
|
||||
void testBinSemaphoreImplementation(SemaphoreIF* binSemaph, std::string id);
|
||||
void testCountingSemaph();
|
||||
void testCountingSemaphImplementation(SemaphoreIF* countingSemaph,
|
||||
std::string id);
|
||||
}
|
||||
|
||||
|
||||
#endif /* UNITTEST_INTERNAL_INTTESTSEMAPHORE_H_ */
|
@ -0,0 +1,16 @@
|
||||
#ifndef FSFW_UNITTEST_INTERNAL_INTTESTSERIALIZATION_H_
|
||||
#define FSFW_UNITTEST_INTERNAL_INTTESTSERIALIZATION_H_
|
||||
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include <array>
|
||||
|
||||
namespace testserialize {
|
||||
ReturnValue_t test_serialization();
|
||||
ReturnValue_t test_endianness_tools();
|
||||
ReturnValue_t test_autoserialization();
|
||||
ReturnValue_t test_serial_buffer_adapter();
|
||||
|
||||
extern std::array<uint8_t, 512> test_array;
|
||||
}
|
||||
|
||||
#endif /* FSFW_UNITTEST_INTERNAL_INTTESTSERIALIZATION_H_ */
|
@ -4,3 +4,5 @@ add_subdirectory(osal)
|
||||
add_subdirectory(serialize)
|
||||
add_subdirectory(datapoollocal)
|
||||
add_subdirectory(storagemanager)
|
||||
add_subdirectory(globalfunctions)
|
||||
add_subdirectory(tmtcpacket)
|
Reference in New Issue
Block a user