Add a unit test app + example tests
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
include(../common.cmake)
|
||||
|
||||
# Treat warnings as errors for test purposes.
|
||||
list(APPEND EXTRA_WARNINGS "-Werror")
|
||||
|
||||
# List all components that include tests here.
|
||||
set(TEST_COMPONENTS "drivers")
|
||||
|
||||
project(device_tests)
|
||||
@@ -0,0 +1 @@
|
||||
idf_component_register(SRCS "main.c" INCLUDE_DIRS ".")
|
||||
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "unity.h"
|
||||
|
||||
static void print_banner(const char* text);
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
print_banner("Running tests without [ignore] tag");
|
||||
UNITY_BEGIN();
|
||||
unity_run_tests_by_tag("[ignore]", true);
|
||||
UNITY_END();
|
||||
|
||||
print_banner("Starting interactive test menu");
|
||||
unity_run_menu();
|
||||
}
|
||||
|
||||
static void print_banner(const char* text)
|
||||
{
|
||||
printf("\n#### %s #####\n\n", text);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
CONFIG_ESP_TASK_WDT=n
|
||||
|
||||
Reference in New Issue
Block a user