feat(unity): upgrade to 2.6.0-RC1

This commit is contained in:
Ivan Grokhotkov
2023-11-27 14:21:49 +01:00
parent 4b0da52aa8
commit 88fa79fcc7
13 changed files with 78 additions and 16 deletions

View File

@@ -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"

View File

@@ -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

View 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;
}