2024-11-17 05:36:11 +00:00
|
|
|
/**
|
|
|
|
|
* @file BNO08xTestSuite.hpp
|
|
|
|
|
* @author Myles Parfeniuk
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @warning YOU MUST ADD THE FOLLOWING LINE TO YOUR MAIN PROJECTS CMakeLists.txt IN ORDER FOR THIS TEST SUITE TO BE BUILT WITH PROJECT:
|
|
|
|
|
* set(TEST_COMPONENTS "esp32_BNO08x" CACHE STRING "Components to test.")
|
|
|
|
|
*/
|
2024-11-14 21:29:46 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "unity.h"
|
|
|
|
|
#include "BNO08xTestHelper.hpp"
|
|
|
|
|
|
2024-11-17 05:36:11 +00:00
|
|
|
/**
|
|
|
|
|
* @class BNO08xTestSuite
|
2024-11-18 00:52:07 +00:00
|
|
|
*
|
2024-11-17 05:36:11 +00:00
|
|
|
* @brief BNO08x unit test launch point class.
|
|
|
|
|
* */
|
2024-11-14 21:29:46 +00:00
|
|
|
class BNO08xTestSuite
|
|
|
|
|
{
|
2024-11-14 22:25:18 +00:00
|
|
|
private:
|
|
|
|
|
static void print_begin_tests_banner(const char* test_set_name)
|
|
|
|
|
{
|
|
|
|
|
printf("####################### BEGIN TESTS: %s #######################\n\r", test_set_name);
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-15 01:48:02 +00:00
|
|
|
static void print_end_tests_banner(const char* test_set_name)
|
2024-11-14 22:25:18 +00:00
|
|
|
{
|
|
|
|
|
printf("####################### END TESTS: %s #######################\n\r", test_set_name);
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-14 21:29:46 +00:00
|
|
|
public:
|
2024-11-14 22:25:18 +00:00
|
|
|
static void run_all_tests()
|
|
|
|
|
{
|
2024-11-16 22:22:28 +00:00
|
|
|
UNITY_BEGIN();
|
|
|
|
|
run_init_deinit_tests(false);
|
2024-11-17 20:36:19 +00:00
|
|
|
run_single_report_tests(false);
|
|
|
|
|
run_multi_report_tests(false);
|
2024-11-17 23:01:33 +00:00
|
|
|
run_callback_tests(false);
|
2024-11-16 22:22:28 +00:00
|
|
|
UNITY_END();
|
2024-11-14 22:25:18 +00:00
|
|
|
}
|
|
|
|
|
|
2024-11-16 22:22:28 +00:00
|
|
|
static void run_init_deinit_tests(bool call_unity_end_begin = true)
|
2024-11-14 22:25:18 +00:00
|
|
|
{
|
|
|
|
|
print_begin_tests_banner("init_denit_tests");
|
|
|
|
|
|
2024-11-16 22:22:28 +00:00
|
|
|
if (call_unity_end_begin)
|
|
|
|
|
UNITY_BEGIN();
|
|
|
|
|
|
2024-11-16 17:21:44 +00:00
|
|
|
unity_run_tests_by_tag("[InitComprehensive]", false);
|
2024-11-15 01:48:02 +00:00
|
|
|
unity_run_tests_by_tag("[InitDenit]", false);
|
2024-11-16 22:22:28 +00:00
|
|
|
|
|
|
|
|
if (call_unity_end_begin)
|
|
|
|
|
UNITY_END();
|
2024-11-14 21:29:46 +00:00
|
|
|
|
2024-11-14 22:25:18 +00:00
|
|
|
print_end_tests_banner("init_denit_tests");
|
|
|
|
|
}
|
2024-11-15 01:48:02 +00:00
|
|
|
|
2024-11-17 20:36:19 +00:00
|
|
|
static void run_single_report_tests(bool call_unity_end_begin = true)
|
2024-11-15 01:48:02 +00:00
|
|
|
{
|
2024-11-17 20:36:19 +00:00
|
|
|
print_begin_tests_banner("single_report_tests");
|
2024-11-15 01:48:02 +00:00
|
|
|
|
2024-11-16 22:22:28 +00:00
|
|
|
if (call_unity_end_begin)
|
|
|
|
|
UNITY_BEGIN();
|
|
|
|
|
|
2024-11-16 17:21:44 +00:00
|
|
|
unity_run_tests_by_tag("[SingleReportEnableDisable]", false);
|
2024-11-16 22:22:28 +00:00
|
|
|
|
|
|
|
|
if (call_unity_end_begin)
|
|
|
|
|
UNITY_END();
|
2024-11-15 01:48:02 +00:00
|
|
|
|
2024-11-17 20:36:19 +00:00
|
|
|
print_end_tests_banner("single_report_tests");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void run_multi_report_tests(bool call_unity_end_begin = true)
|
|
|
|
|
{
|
|
|
|
|
print_begin_tests_banner("multi_report_tests");
|
|
|
|
|
|
|
|
|
|
if (call_unity_end_begin)
|
|
|
|
|
UNITY_BEGIN();
|
|
|
|
|
|
|
|
|
|
unity_run_tests_by_tag("[MultiReportEnableDisable]", false);
|
|
|
|
|
|
|
|
|
|
if (call_unity_end_begin)
|
|
|
|
|
UNITY_END();
|
|
|
|
|
|
|
|
|
|
print_end_tests_banner("multi_report_tests");
|
2024-11-15 01:48:02 +00:00
|
|
|
}
|
2024-11-17 23:01:33 +00:00
|
|
|
|
|
|
|
|
static void run_callback_tests(bool call_unity_end_begin = true)
|
|
|
|
|
{
|
|
|
|
|
print_begin_tests_banner("run_callback_tests");
|
|
|
|
|
|
|
|
|
|
if (call_unity_end_begin)
|
|
|
|
|
UNITY_BEGIN();
|
|
|
|
|
|
|
|
|
|
unity_run_tests_by_tag("[CallbackTests]", false);
|
|
|
|
|
|
|
|
|
|
if (call_unity_end_begin)
|
|
|
|
|
UNITY_END();
|
|
|
|
|
|
|
|
|
|
print_end_tests_banner("run_callback_tests");
|
|
|
|
|
}
|
2024-11-14 21:29:46 +00:00
|
|
|
};
|