Merge branch 'master' into feature/esp32s2beta_update

This commit is contained in:
Angus Gratton
2019-08-08 13:44:24 +10:00
committed by Angus Gratton
2414 changed files with 160787 additions and 45783 deletions

View File

@@ -1,18 +1,21 @@
set(COMPONENT_SRCS "unity/src/unity.c"
"unity_port_esp32.c")
set(srcs
"unity/src/unity.c"
"unity_port_esp32.c")
set(COMPONENT_ADD_INCLUDEDIRS "include"
"unity/src")
if(CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL)
list(APPEND COMPONENT_PRIV_INCLUDEDIRS "include/priv")
endif()
if(CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER)
list(APPEND COMPONENT_SRCS "unity_runner.c")
list(APPEND srcs "unity_runner.c")
endif()
if(CONFIG_UNITY_ENABLE_FIXTURE)
list(APPEND COMPONENT_SRCS "unity/extras/fixture/src/unity_fixture.c")
list(APPEND srcs "unity/extras/fixture/src/unity_fixture.c")
endif()
register_component()
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "include" "unity/src")
target_compile_definitions(${COMPONENT_LIB} PUBLIC
-DUNITY_INCLUDE_CONFIG_H

View File

@@ -42,4 +42,12 @@ menu "Unity unit testing library"
the build. These provide an optional set of macros and functions to
implement test groups.
endmenu # "Unity unit testing library"
config UNITY_ENABLE_BACKTRACE_ON_FAIL
bool "Print a backtrace when a unit test fails"
default n
help
If set, the unity framework will print the backtrace information before
jumping back to the test menu. The jumping is usually occurs in assert
functions such as TEST_ASSERT, TEST_FAIL etc.
endmenu # "Unity unit testing library"

View File

@@ -9,6 +9,10 @@ endif
COMPONENT_ADD_INCLUDEDIRS = include unity/src
COMPONENT_SRCDIRS = unity/src .
ifdef CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL
COMPONENT_PRIV_INCLUDEDIRS += include/priv
endif
ifndef CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER
COMPONENT_OBJEXCLUDE += unity_runner.o
endif

View File

@@ -0,0 +1,14 @@
#include_next <setjmp.h>
#include "esp_debug_helpers.h"
/*
* This is the middle layer of setjmp to be used with the unity.
*/
/** Insert backtrace before longjmp (TEST_ABORT).
*
* Currently we only do long jump before test is ignored or failed.
* If this is also called when test pass, we may need to add some check before
* backtrace is called.
*/
#define longjmp(buf, val) do {esp_backtrace_print(100); longjmp(buf, val);} while(0)