esp32_BNO08x/include/BNO08xTestSuite.hpp

65 lines
1.8 KiB
C++
Raw Normal View History

2024-11-14 21:29:46 +00:00
#pragma once
/*
YOU MUST ADD THE FOLLOWING LINE TO YOUR MAIN PROJECTS CMakeLists.txt IN ORDER FOR THIS TEST SUITE TO BE FUNCTIONAL:
set(TEST_COMPONENTS "esp32_BNO08x" CACHE STRING "Components to test.")
*/
#include <stdio.h>
#include <string.h>
#include "unity.h"
#include "BNO08xTestHelper.hpp"
class BNO08xTestSuite
{
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)
{
printf("####################### END TESTS: %s #######################\n\r", test_set_name);
}
2024-11-14 21:29:46 +00:00
public:
static void run_all_tests()
{
2024-11-16 22:22:28 +00:00
UNITY_BEGIN();
run_init_deinit_tests(false);
run_report_tests(false);
UNITY_END();
}
2024-11-16 22:22:28 +00:00
static void run_init_deinit_tests(bool call_unity_end_begin = true)
{
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
print_end_tests_banner("init_denit_tests");
}
2024-11-15 01:48:02 +00:00
2024-11-16 22:22:28 +00:00
static void run_report_tests(bool call_unity_end_begin = true)
2024-11-15 01:48:02 +00:00
{
print_begin_tests_banner("report_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("[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
print_end_tests_banner("report_tests");
}
2024-11-14 21:29:46 +00:00
};