mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 20:00:53 +00:00
feat(unity): upgrade to 2.6.0-RC1
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
|
||||
set(srcs
|
||||
"unity/src/unity.c")
|
||||
"unity/src/unity.c"
|
||||
"unity_compat.c"
|
||||
)
|
||||
|
||||
set(includes
|
||||
"include"
|
||||
|
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <esp_err.h>
|
||||
#include <stddef.h>
|
||||
#include <math.h>
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifdef CONFIG_UNITY_ENABLE_FLOAT
|
||||
@@ -29,6 +30,18 @@
|
||||
#define UNITY_OUTPUT_COLOR
|
||||
#endif
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define UNITY_IS_NAN isnan
|
||||
#define UNITY_IS_INF isinf
|
||||
#else
|
||||
#define UNITY_IS_NAN std::isnan
|
||||
#define UNITY_IS_INF std::isinf
|
||||
#endif
|
||||
|
||||
// Note, using __noreturn__ rather than noreturn
|
||||
// https://github.com/espressif/esp-idf/issues/11339
|
||||
#define UNITY_NORETURN __attribute__((__noreturn__))
|
||||
|
||||
#define UNITY_EXCLUDE_TIME_H
|
||||
|
||||
void unity_flush(void);
|
||||
@@ -51,6 +64,10 @@ uint32_t unity_exec_time_get_ms(void);
|
||||
#endif //CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER
|
||||
|
||||
#ifdef CONFIG_UNITY_ENABLE_FIXTURE
|
||||
// Two separate "extras" options here:
|
||||
// 1. Disable memory allocation wrappers in Unity Fixture
|
||||
#define UNITY_FIXTURE_NO_EXTRAS
|
||||
// 2. Add IDF-specific additions to Unity Fixture
|
||||
#include "unity_fixture_extras.h"
|
||||
#endif // CONFIG_UNITY_ENABLE_FIXTURE
|
||||
|
||||
|
Submodule components/unity/unity updated: 7d2bf62b7e...bf560290f6
28
components/unity/unity_compat.c
Normal file
28
components/unity/unity_compat.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "unity.h"
|
||||
|
||||
// Unity 2.6.0 has removed weak definitions of setUp, tearDown, suiteSetUp and suiteTearDown.
|
||||
// (https://github.com/ThrowTheSwitch/Unity/pull/454)
|
||||
// We need to provide them here to avoid breaking the existing test applications.
|
||||
|
||||
__attribute__((weak)) void setUp(void)
|
||||
{
|
||||
}
|
||||
|
||||
__attribute__((weak)) void tearDown(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
__attribute__((weak)) void suiteSetUp(void)
|
||||
{
|
||||
}
|
||||
|
||||
__attribute__((weak)) int suiteTearDown(int num_failures)
|
||||
{
|
||||
return num_failures;
|
||||
}
|
Reference in New Issue
Block a user