mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-06-30 04:21:00 +02:00
IDF master c13afea63 (#5214)
esp-dsp: master 7cc5073 esp-face: master 420fc7e esp-rainmaker: f1b82c7 esp32-camera: master 6f8489e esp_littlefs: master b58f00c
This commit is contained in:
@ -21,13 +21,16 @@
|
||||
#define UNITY_EXCLUDE_DOUBLE
|
||||
#endif //CONFIG_UNITY_ENABLE_DOUBLE
|
||||
|
||||
#ifdef CONFIG_UNITY_ENABLE_64BIT
|
||||
#define UNITY_SUPPORT_64
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_UNITY_ENABLE_COLOR
|
||||
#define UNITY_OUTPUT_COLOR
|
||||
#endif
|
||||
|
||||
#define UNITY_EXCLUDE_TIME_H
|
||||
|
||||
|
||||
void unity_flush(void);
|
||||
void unity_putc(int c);
|
||||
void unity_gets(char* dst, size_t len);
|
||||
|
@ -1,25 +1,78 @@
|
||||
/* IDF-specific additions to "Unity Fixture" */
|
||||
// Copyright 2016-2021 Espressif Systems (Shanghai) Co. Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/* IDF-specific additions to "Unity Fixture".
|
||||
* This file doesn't need to be included directly, it gets included into unity.h
|
||||
* through unity_config.h.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef CONFIG_IDF_TARGET
|
||||
#include "sdkconfig.h"
|
||||
|
||||
/* A shorthand for running one test group from the main function */
|
||||
#define UNITY_MAIN(group_) do { \
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_IDF_TARGET) || defined(CONFIG_IDF_TARGET_LINUX)
|
||||
#define UNITY_MAYBE_EXIT(rc) do { exit(rc); } while(0)
|
||||
#else
|
||||
#define UNITY_MAYBE_EXIT(rc) do { (void) rc; } while(0)
|
||||
#endif
|
||||
|
||||
/* A shorthand for running all tests called from one function "func_", from the app_main function.
|
||||
* Use this when there is more than one test group.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* #include "unity.h"
|
||||
* #include "unity_fixture.h"
|
||||
*
|
||||
* static_void run_all_tests(void) {
|
||||
* RUN_TEST_GROUP(group1); // test group defined in another file, e.g. test_group1.c
|
||||
* RUN_TEST_GROUP(group2); // test group defined in another file, e.g. test_group2.c
|
||||
* }
|
||||
*
|
||||
* void app_main(void) {
|
||||
* UNITY_MAIN_FUNC(run_all_tests);
|
||||
* }
|
||||
*/
|
||||
#define UNITY_MAIN_FUNC(func_) do { \
|
||||
const char* argv[] = { "test", "-v" }; \
|
||||
const int argc = sizeof(argv)/sizeof(argv[0]); \
|
||||
int rc = UnityMain(argc, argv, TEST_ ## group_ ## _GROUP_RUNNER); \
|
||||
int rc = UnityMain(argc, argv, func_); \
|
||||
printf("\nTests finished, rc=%d\n", rc); \
|
||||
exit(rc); \
|
||||
UNITY_MAYBE_EXIT(rc); \
|
||||
} while(0)
|
||||
|
||||
#else // CONFIG_IDF_TARGET
|
||||
/* A shorthand for running one test group from the app_main function, when there is only
|
||||
* one test group and it is defined in the same file.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* #include "unity.h"
|
||||
* #include "unity_fixture.h"
|
||||
*
|
||||
* TEST_GROUP(my_feature);
|
||||
* // also define TEST_SETUP, TEST_TEARDOWN, TESTs, TEST_GROUP_RUNNER
|
||||
*
|
||||
* void app_main(void) {
|
||||
* UNITY_MAIN(my_feature);
|
||||
* }
|
||||
*/
|
||||
#define UNITY_MAIN(group_) UNITY_MAIN_FUNC(TEST_ ## group_ ## _GROUP_RUNNER)
|
||||
|
||||
/* A shorthand for running one test group from the main function */
|
||||
#define UNITY_MAIN(group_) do { \
|
||||
const char* argv[] = { "test", "-v" }; \
|
||||
const int argc = sizeof(argv)/sizeof(argv[0]); \
|
||||
int rc = UnityMain(argc, argv, TEST_ ## group_ ## _GROUP_RUNNER); \
|
||||
printf("\nTests finished, rc=%d\n", rc); \
|
||||
} while(0)
|
||||
|
||||
#endif // CONFIG_IDF_TARGET
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user