finished freertos unittests, valgrind not happy yet

This commit is contained in:
2023-01-13 16:30:47 +01:00
parent 39dad5f45b
commit 47d85fb61c
6 changed files with 48 additions and 86 deletions

View File

@ -24,15 +24,19 @@ extern int customTeardown();
#ifdef FSFW_OSAL_FREERTOS
struct Taskparameters {
int argc; char** argv;
int argc; char** argv;TaskHandle_t catchTask;
} taskParameters;
void unittestTaskFunction( void *pvParameters ) {
puts("go");
Taskparameters* parameters = (Taskparameters*)pvParameters;
int result = Catch::Session().run(parameters->argc, parameters->argv);
puts("gone");
vTaskDelete( NULL );
vTaskDelay(pdMS_TO_TICKS(10));
vTaskSuspendAll();
vTaskDelete(parameters->catchTask);
customTeardown();
exit(result);
}
#endif
@ -42,21 +46,17 @@ int main(int argc, char* argv[]) {
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.catchTask); /* The task handle is not required, so NULL is passed. */
taskParameters.argc = argc;
taskParameters.argv = argv;
vTaskStartScheduler();
#else
puts("nom");
// Catch internal function call
result = Catch::Session().run(argc, argv);
#endif