unittests running but failing
This commit is contained in:
@ -11,15 +11,55 @@
|
||||
#define CATCH_CONFIG_COLOUR_WINDOWS
|
||||
|
||||
#include <catch2/catch_session.hpp>
|
||||
#include <fsfw/osal/osal.h>
|
||||
|
||||
#ifdef FSFW_OSAL_FREERTOS
|
||||
#include <FreeRTOS.h>
|
||||
#include "task.h"
|
||||
#endif
|
||||
|
||||
extern int customSetup();
|
||||
extern int customTeardown();
|
||||
|
||||
|
||||
#ifdef FSFW_OSAL_FREERTOS
|
||||
struct Taskparameters {
|
||||
int argc; char** argv;
|
||||
} taskParameters;
|
||||
|
||||
void unittestTaskFunction( void *pvParameters ) {
|
||||
puts("go");
|
||||
Taskparameters* parameters = (Taskparameters*)pvParameters;
|
||||
int result = Catch::Session().run(parameters->argc, parameters->argv);
|
||||
puts("gone");
|
||||
vTaskDelete( NULL );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
customSetup();
|
||||
|
||||
int result = 0;
|
||||
|
||||
puts("pre");
|
||||
|
||||
#ifdef FSFW_OSAL_FREERTOS
|
||||
puts("task");
|
||||
xTaskCreate( unittestTaskFunction, /* The function that implements the task. */
|
||||
"Unittests", /* The text name assigned to the task - for debug only as it is not used by the kernel. */
|
||||
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */
|
||||
&taskParameters, /* The parameter passed to the task - not used in this simple case. */
|
||||
1, /* The priority assigned to the task. */
|
||||
NULL ); /* The task handle is not required, so NULL is passed. */
|
||||
taskParameters.argc = argc;
|
||||
taskParameters.argv = argv;
|
||||
vTaskStartScheduler();
|
||||
#else
|
||||
puts("nom");
|
||||
// Catch internal function call
|
||||
int result = Catch::Session().run(argc, argv);
|
||||
result = Catch::Session().run(argc, argv);
|
||||
#endif
|
||||
|
||||
// global clean-up
|
||||
customTeardown();
|
||||
|
Reference in New Issue
Block a user