Skip to content

Commit defc80a

Browse files
committed
CMake: Remove alias for TEST_NAME argument
The mbed_greentea_add_test macro previously set a variable in order to use the un-prefixed TEST_NAME to refer to the argument in the macro body. Whilst pair-programming with LDong, this was identified and determined to be unecessary (maybe it was a failed attempt to fix something, that was never reversed?) and so it has been removed.
1 parent 3e71692 commit defc80a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

tools/cmake/mbed_greentea.cmake

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,22 @@ macro(mbed_greentea_add_test)
3535
${ARGN}
3636
)
3737

38-
set(TEST_NAME ${MBED_GREENTEA_TEST_NAME})
39-
4038
add_subdirectory(${MBED_PATH} build)
4139

42-
add_executable(${TEST_NAME})
40+
add_executable(${MBED_GREENTEA_TEST_NAME})
4341

4442
# Explicitly enable BUILD_TESTING until CTest is added to the Greentea client
4543
set(BUILD_TESTING ON)
4644

47-
mbed_configure_app_target(${TEST_NAME})
45+
mbed_configure_app_target(${MBED_GREENTEA_TEST_NAME})
4846

49-
target_include_directories(${TEST_NAME}
47+
target_include_directories(${MBED_GREENTEA_TEST_NAME}
5048
PRIVATE
5149
.
5250
${MBED_GREENTEA_TEST_INCLUDE_DIRS}
5351
)
5452

55-
target_sources(${TEST_NAME}
53+
target_sources(${MBED_GREENTEA_TEST_NAME}
5654
PRIVATE
5755
main.cpp
5856
${MBED_GREENTEA_TEST_SOURCES}
@@ -67,16 +65,16 @@ macro(mbed_greentea_add_test)
6765
if (DEFINED MBED_TEST_LINK_LIBRARIES)
6866
separate_arguments(MBED_TEST_LINK_LIBRARIES)
6967
list(APPEND MBED_GREENTEA_TEST_REQUIRED_LIBS ${MBED_TEST_LINK_LIBRARIES} mbed-greentea)
70-
else()
68+
else()
7169
list(APPEND MBED_GREENTEA_TEST_REQUIRED_LIBS mbed-greentea)
7270
endif()
7371

74-
target_link_libraries(${TEST_NAME}
72+
target_link_libraries(${MBED_GREENTEA_TEST_NAME}
7573
PRIVATE
7674
${MBED_GREENTEA_TEST_REQUIRED_LIBS}
7775
)
7876

79-
mbed_set_post_build(${TEST_NAME})
77+
mbed_set_post_build(${MBED_GREENTEA_TEST_NAME})
8078

8179
option(VERBOSE_BUILD "Have a verbose build process")
8280
if(VERBOSE_BUILD)

0 commit comments

Comments
 (0)