ud3tn/test/unit/main.c
Felix Walter 62d563449f test: Remove the Unity wrappers for memory allocation functions
This adds a custom header that does explicitly not include the Unity
wrappers for malloc, free, etc. by defining the guard used by that header
file. This way we can remove the wrappers provided via the linker
altogether.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-15 11:39:29 +02:00

48 lines
931 B
C

// SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0
#include "ud3tn/init.h"
#include "ud3tn/cmdline.h"
#include "platform/hal_io.h"
#include "platform/hal_platform.h"
#include "platform/hal_task.h"
#include "testud3tn_unity.h"
#include <stdio.h>
#include <stdlib.h>
void testud3tn(void);
static int test_errors;
void test_task(void *args)
{
static const char *argv[1] = { "testud3tn" };
LOG("Starting testsuite...");
hal_io_message_printf("\n");
/* Disable the logger spamming out output */
/* Start Unity */
test_errors = UnityMain(1, argv, testud3tn);
hal_io_message_printf("\n");
if (!test_errors) {
LOG("uD3TN unittests succeeded.");
exit(EXIT_SUCCESS);
} else {
LOGF("uD3TN unittests resulted in %d error(s).", test_errors);
exit(EXIT_FAILURE);
}
}
int main(void)
{
char *argv[1] = {"<undefined>"};
init(1, argv);
hal_task_create(test_task, "test_task", 0, NULL, 0);
return start_os();
}