42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
/**
|
|
* @file unitTest.cpp
|
|
* @author Gustice
|
|
* @brief Unit/Integration-Test frame for hardware bound components
|
|
*/
|
|
|
|
#include "unity.h"
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/task.h"
|
|
|
|
extern "C" { // This switch allows the ROS C-implementation to find this main
|
|
void app_main(void);
|
|
}
|
|
|
|
void app_main(void) {
|
|
printf("\n#### Running all the registered tests #####\n\n");
|
|
UNITY_BEGIN();
|
|
unity_run_all_tests();
|
|
// Alternatively:
|
|
// "Executing one test by its name"
|
|
// unity_run_test_by_name("Mean of an empty array is zero");
|
|
// Running tests with [mean] tag"
|
|
// unity_run_tests_by_tag("[mean]", false);
|
|
// print_banner("Running tests without [fails] tag");
|
|
// unity_run_tests_by_tag("[fails]", true);
|
|
UNITY_END();
|
|
|
|
printf("\n#### Starting interactive test menu: ####\n");
|
|
printf("# - run explicit #\n");
|
|
printf("- run all with *, \n");
|
|
printf("# - run tagged with [tag], \n");
|
|
printf("# - run all other than ![tag])\n");
|
|
printf("# Exit with 'Ctrl-]'\n");
|
|
// unity_run_menu(); // Watchdog needs to
|
|
|
|
while (true) {
|
|
vTaskDelay(10);
|
|
}
|
|
}
|