添加智能灯固件代码

This commit is contained in:
kerwincui
2021-07-13 17:14:51 +08:00
parent 332f74dd17
commit ecc0b91b8b
2568 changed files with 229441 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.5)
# Include the components directory of the main application:
#
set(EXTRA_COMPONENT_DIRS "../components")
# Set the components to include the tests for.
# This can be overriden from CMake cache:
# - when invoking CMake directly: cmake -D TEST_COMPONENTS="xxxxx" ..
# - when using idf.py: idf.py -T xxxxx build
#
set(TEST_COMPONENTS "testable" CACHE STRING "List of components to test")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(unit_test_test)

View File

@@ -0,0 +1,17 @@
#
# This is a project Makefile for the test subproject.
#
PROJECT_NAME := unit_test_test
# Include the components directory of the main application:
#
EXTRA_COMPONENT_DIRS := $(realpath ../components)
# Set the components to include the tests for.
# This can be overriden from the command line
# (e.g. 'make TEST_COMPONENTS=xxxx flash monitor')
#
TEST_COMPONENTS ?= testable
include $(IDF_PATH)/make/project.mk

View File

@@ -0,0 +1,2 @@
idf_component_register(SRCS "example_unit_test_test.c"
INCLUDE_DIRS ".")

View File

@@ -0,0 +1,55 @@
/* Example test application for testable component.
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include <string.h>
#include "unity.h"
static void print_banner(const char* text);
void app_main(void)
{
/* These are the different ways of running registered tests.
* In practice, only one of them is usually needed.
*
* UNITY_BEGIN() and UNITY_END() calls tell Unity to print a summary
* (number of tests executed/failed/ignored) of tests executed between these calls.
*/
print_banner("Executing one test by its name");
UNITY_BEGIN();
unity_run_test_by_name("Mean of an empty array is zero");
UNITY_END();
print_banner("Running tests with [mean] tag");
UNITY_BEGIN();
unity_run_tests_by_tag("[mean]", false);
UNITY_END();
print_banner("Running tests without [fails] tag");
UNITY_BEGIN();
unity_run_tests_by_tag("[fails]", true);
UNITY_END();
print_banner("Running all the registered tests");
UNITY_BEGIN();
unity_run_all_tests();
UNITY_END();
print_banner("Starting interactive test menu");
/* This function will not return, and will be busy waiting for UART input.
* Make sure that task watchdog is disabled if you use this function.
*/
unity_run_menu();
}
static void print_banner(const char* text)
{
printf("\n#### %s #####\n\n", text);
}

View File

@@ -0,0 +1 @@
CONFIG_ESP_TASK_WDT=n