Skip to content

Commit 8206d5a

Browse files
committed
testing/esp: not include deprecated header
1 parent 50fe5b6 commit 8206d5a

File tree

3 files changed

+39
-42
lines changed

3 files changed

+39
-42
lines changed

testing/esp/test_apps/gen_ut_app/main/CMakeLists.txt

+31-41
Original file line numberDiff line numberDiff line change
@@ -29,57 +29,47 @@ if(get_idf_ver)
2929
execute_process(COMMAND ${idf_ver_script} $ENV{IDF_PATH} -c major
3030
OUTPUT_STRIP_TRAILING_WHITESPACE
3131
OUTPUT_VARIABLE UT_IDF_VER_MAJOR)
32+
execute_process(COMMAND ${idf_ver_script} $ENV{IDF_PATH} -c minor
33+
OUTPUT_STRIP_TRAILING_WHITESPACE
34+
OUTPUT_VARIABLE UT_IDF_VER_MINOR)
35+
execute_process(COMMAND ${idf_ver_script} $ENV{IDF_PATH} -c bugfix
36+
OUTPUT_STRIP_TRAILING_WHITESPACE
37+
OUTPUT_VARIABLE UT_IDF_VER_BUGFIX)
3238
else()
3339
message("Skip getting IDF version. Use the latest as default.")
3440
set(UT_IDF_VER 0xFFFFFFFF)
41+
set(UT_IDF_VER_MAJOR 0xFF)
42+
set(UT_IDF_VER_MINOR 0xFF)
43+
set(UT_IDF_VER_BUGFIX 0xFF)
3544
endif()
3645

3746
configure_file(ut_idf_ver.h.in ${idf_ver_header_path} @ONLY)
3847
include_directories(${CMAKE_CURRENT_BINARY_DIR})
3948

4049
message("IDF version is ${UT_IDF_VER}")
41-
if(UT_IDF_VER_MAJOR STREQUAL "3")
42-
if(CONFIG_ESP32_GCOV_ENABLE)
43-
target_compile_options(${COMPONENT_TARGET} PRIVATE --coverage)
44-
endif()
45-
46-
if(NOT CONFIG_GEN_UT_APP_CUSTOM_LD_FILENAME STREQUAL "")
47-
target_linker_script(${COMPONENT_TARGET} "${CONFIG_GEN_UT_APP_CUSTOM_LD_FILENAME}")
48-
endif()
50+
if(CONFIG_ESP32_GCOV_ENABLE)
51+
target_compile_options(${COMPONENT_LIB} PRIVATE --coverage)
52+
endif()
4953

50-
target_link_libraries(${COMPONENT_TARGET} "-u include_xt_highint5")
51-
target_link_libraries(${COMPONENT_TARGET} "-u unused_func0")
52-
target_link_libraries(${COMPONENT_TARGET} "-u unused_func1")
53-
target_link_libraries(${COMPONENT_TARGET} "-u unused_func2")
54-
target_link_libraries(${COMPONENT_TARGET} "-u unused_func3")
55-
target_link_libraries(${COMPONENT_TARGET} "-u unused_func4")
56-
target_link_libraries(${COMPONENT_TARGET} "-u unused_func5")
57-
target_link_libraries(${COMPONENT_TARGET} "-u unused_func6")
58-
target_link_libraries(${COMPONENT_TARGET} "-u unused_func7")
59-
else()
60-
if(CONFIG_ESP32_GCOV_ENABLE)
61-
target_compile_options(${COMPONENT_LIB} PRIVATE --coverage)
54+
if(NOT CONFIG_GEN_UT_APP_CUSTOM_LD_FILENAME STREQUAL "")
55+
if(CONFIG_IDF_TARGET_ESP32)
56+
target_linker_script(${COMPONENT_LIB} INTERFACE "${CONFIG_GEN_UT_APP_CUSTOM_LD_FILENAME_ESP32}")
57+
elseif(CONFIG_IDF_TARGET_ESP32S2)
58+
target_linker_script(${COMPONENT_LIB} INTERFACE "${CONFIG_GEN_UT_APP_CUSTOM_LD_FILENAME_ESP32S2}")
59+
elseif(CONFIG_IDF_TARGET_ESP32S3)
60+
target_linker_script(${COMPONENT_LIB} INTERFACE "${CONFIG_GEN_UT_APP_CUSTOM_LD_FILENAME_ESP32S3}")
61+
else()
62+
message(FATAL_ERROR "Custom linker not exist for this target. CMake will exit!")
6263
endif()
64+
endif()
6365

64-
if(NOT CONFIG_GEN_UT_APP_CUSTOM_LD_FILENAME STREQUAL "")
65-
if(CONFIG_IDF_TARGET_ESP32)
66-
target_linker_script(${COMPONENT_LIB} INTERFACE "${CONFIG_GEN_UT_APP_CUSTOM_LD_FILENAME_ESP32}")
67-
elseif(CONFIG_IDF_TARGET_ESP32S2)
68-
target_linker_script(${COMPONENT_LIB} INTERFACE "${CONFIG_GEN_UT_APP_CUSTOM_LD_FILENAME_ESP32S2}")
69-
elseif(CONFIG_IDF_TARGET_ESP32S3)
70-
target_linker_script(${COMPONENT_LIB} INTERFACE "${CONFIG_GEN_UT_APP_CUSTOM_LD_FILENAME_ESP32S3}")
71-
else()
72-
message(FATAL_ERROR "Custom linker not exist for this target. CMake will exit!")
73-
endif()
74-
endif()
66+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u include_xt_highint5")
67+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func0")
68+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func1")
69+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func2")
70+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func3")
71+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func4")
72+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func5")
73+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func6")
74+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func7")
7575

76-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u include_xt_highint5")
77-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func0")
78-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func1")
79-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func2")
80-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func3")
81-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func4")
82-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func5")
83-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func6")
84-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u unused_func7")
85-
endif()

testing/esp/test_apps/gen_ut_app/main/gen_ut_app.c

+4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
#include "freertos/task.h"
1414
#include "gen_ut_app.h"
1515
#if CONFIG_IDF_TARGET_ARCH_XTENSA
16+
#if (UT_IDF_VER_MAJOR == 5) && (UT_IDF_VER_MINOR <= 1)
1617
#include "freertos/xtensa_api.h"
18+
#else
19+
#include "xtensa_api.h"
20+
#endif
1721
#include "xtensa/core-macros.h"
1822
#endif
1923

Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
#define UT_IDF_VER @UT_IDF_VER@
1+
#define UT_IDF_VER @UT_IDF_VER@
2+
#define UT_IDF_VER_MAJOR @UT_IDF_VER_MAJOR@
3+
#define UT_IDF_VER_MINOR @UT_IDF_VER_MINOR@
4+
#define UT_IDF_VER_BUGFIX @UT_IDF_VER_BUGFIX@

0 commit comments

Comments
 (0)