forked from espressif/esp-idf
Fixed unity fixture for ESP32/S2
* Created compile switch for UNITY_MAIN since it was using exit() syscall leading to abort() on ESP
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# This is the project CMakeLists.txt file for the test subproject
|
# This is the project CMakeLists.txt file for the test subproject
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
|
set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components")
|
||||||
|
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
project(esp_netif_test)
|
project(esp_netif_test)
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
idf_component_register(SRCS "esp_netif_test.c"
|
idf_component_register(SRCS "esp_netif_test.c"
|
||||||
|
REQUIRES test_utils
|
||||||
INCLUDE_DIRS "."
|
INCLUDE_DIRS "."
|
||||||
PRIV_INCLUDE_DIRS "../../private_include" "."
|
PRIV_INCLUDE_DIRS "$ENV{IDF_PATH}/components/esp_netif/private_include" "."
|
||||||
PRIV_REQUIRES unity esp_netif nvs_flash)
|
PRIV_REQUIRES unity esp_netif nvs_flash)
|
||||||
|
@@ -6,9 +6,9 @@
|
|||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
#include "esp_wifi_netif.h"
|
#include "esp_wifi_netif.h"
|
||||||
|
#include "sdkconfig.h"
|
||||||
/* Fixme: re-add test_utils.h */
|
#include "lwip/sockets.h"
|
||||||
static void test_case_uses_tcpip(void) {}
|
#include "test_utils.h"
|
||||||
|
|
||||||
|
|
||||||
TEST_GROUP(esp_netif);
|
TEST_GROUP(esp_netif);
|
||||||
@@ -276,6 +276,7 @@ TEST_GROUP_RUNNER(esp_netif)
|
|||||||
RUN_TEST_CASE(esp_netif, create_delete_multiple_netifs)
|
RUN_TEST_CASE(esp_netif, create_delete_multiple_netifs)
|
||||||
RUN_TEST_CASE(esp_netif, dhcp_client_state_transitions_wifi_sta)
|
RUN_TEST_CASE(esp_netif, dhcp_client_state_transitions_wifi_sta)
|
||||||
RUN_TEST_CASE(esp_netif, dhcp_server_state_transitions_wifi_ap)
|
RUN_TEST_CASE(esp_netif, dhcp_server_state_transitions_wifi_ap)
|
||||||
|
RUN_TEST_CASE(esp_netif, dhcp_server_state_transitions_mesh)
|
||||||
RUN_TEST_CASE(esp_netif, create_custom_wifi_interfaces)
|
RUN_TEST_CASE(esp_netif, create_custom_wifi_interfaces)
|
||||||
RUN_TEST_CASE(esp_netif, get_set_hostname)
|
RUN_TEST_CASE(esp_netif, get_set_hostname)
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
/* IDF-specific additions to "Unity Fixture" */
|
/* IDF-specific additions to "Unity Fixture" */
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef CONFIG_IDF_TARGET
|
||||||
|
|
||||||
/* A shorthand for running one test group from the main function */
|
/* A shorthand for running one test group from the main function */
|
||||||
#define UNITY_MAIN(group_) do { \
|
#define UNITY_MAIN(group_) do { \
|
||||||
const char* argv[] = { "test", "-v" }; \
|
const char* argv[] = { "test", "-v" }; \
|
||||||
@@ -9,3 +11,15 @@
|
|||||||
printf("\nTests finished, rc=%d\n", rc); \
|
printf("\nTests finished, rc=%d\n", rc); \
|
||||||
exit(rc); \
|
exit(rc); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
#else // CONFIG_IDF_TARGET
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
@@ -82,6 +82,8 @@ components/libsodium/
|
|||||||
components/spiffs/include/spiffs_config.h
|
components/spiffs/include/spiffs_config.h
|
||||||
|
|
||||||
components/unity/unity/src/unity_internals.h
|
components/unity/unity/src/unity_internals.h
|
||||||
|
components/unity/unity/extras/
|
||||||
|
components/unity/include/unity_fixture_extras.h
|
||||||
components/unity/include/unity_config.h
|
components/unity/include/unity_config.h
|
||||||
components/unity/include/unity_test_runner.h
|
components/unity/include/unity_test_runner.h
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
|
#include "unity_test_runner.h"
|
||||||
#include "test_utils.h"
|
#include "test_utils.h"
|
||||||
#include "esp_newlib.h"
|
#include "esp_newlib.h"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user