mirror of https://github.com/ARMmbed/mbed-os.git
add auto-naming of unit test suites
parent
c356f1f9d4
commit
3e7ee6c4d1
|
@ -147,11 +147,17 @@ foreach(testfile ${unittest-file-list})
|
|||
# Get source files
|
||||
include("${testfile}")
|
||||
|
||||
if(TEST_SUITE_NAME)
|
||||
set(TEST_SUITES ${TEST_SUITES} ${TEST_SUITE_NAME})
|
||||
else()
|
||||
message(FATAL_ERROR "No TEST_SUITE_NAME found in test file. Add it to ${testfile}.")
|
||||
endif()
|
||||
get_filename_component(TEST_SUITE_DIR ${testfile} DIRECTORY)
|
||||
|
||||
file(RELATIVE_PATH
|
||||
TEST_SUITE_NAME # output
|
||||
${PROJECT_SOURCE_DIR} # root
|
||||
${TEST_SUITE_DIR} #abs dirpath
|
||||
)
|
||||
|
||||
string(REGEX REPLACE "/|\\\\" "-" TEST_SUITE_NAME ${TEST_SUITE_NAME})
|
||||
|
||||
set(TEST_SUITES ${TEST_SUITES} ${TEST_SUITE_NAME})
|
||||
|
||||
set(LIBS_TO_BE_LINKED gmock_main)
|
||||
|
||||
|
@ -178,7 +184,7 @@ foreach(testfile ${unittest-file-list})
|
|||
# Link the executable with the libraries.
|
||||
target_link_libraries(${TEST_SUITE_NAME} ${LIBS_TO_BE_LINKED})
|
||||
|
||||
add_test(NAME "${TEST_SUITE_NAME}UnitTests" COMMAND ${TEST_SUITE_NAME})
|
||||
add_test(NAME "${TEST_SUITE_NAME}" COMMAND ${TEST_SUITE_NAME})
|
||||
|
||||
# Append test build directory to list
|
||||
list(APPEND BUILD_DIRECTORIES "./CMakeFiles/${TEST_SUITE_NAME}.dir")
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
# UNIT TESTS
|
||||
####################
|
||||
|
||||
# Unit test suite name
|
||||
set(TEST_SUITE_NAME "cellular-framework-AT-AT_CellularBase")
|
||||
|
||||
# Add test specific include paths
|
||||
set(unittest-includes ${unittest-includes}
|
||||
features/cellular/framework/AT/AT_CellularBase
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
# UNIT TESTS
|
||||
####################
|
||||
|
||||
# Unit test suite name
|
||||
set(TEST_SUITE_NAME "cellular-framework-common-util")
|
||||
|
||||
# Add test specific include paths
|
||||
set(unittest-includes ${unittest-includes}
|
||||
features/cellular/framework/common/util
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
# UNIT TESTS
|
||||
####################
|
||||
|
||||
# Unit test suite name
|
||||
set(TEST_SUITE_NAME "features-netsocket-InternetSocket")
|
||||
|
||||
set(unittest-sources
|
||||
../features/netsocket/SocketAddress.cpp
|
||||
../features/netsocket/NetworkStack.cpp
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
# UNIT TESTS
|
||||
####################
|
||||
|
||||
# Unit test suite name
|
||||
set(TEST_SUITE_NAME "features-netsocket-NetworkInterface")
|
||||
|
||||
# Source files
|
||||
set(unittest-sources
|
||||
../features/netsocket/NetworkInterface.cpp
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
# UNIT TESTS
|
||||
####################
|
||||
|
||||
# Unit test suite name
|
||||
set(TEST_SUITE_NAME "features-netsocket-TCPSocket")
|
||||
|
||||
set(unittest-sources
|
||||
../features/netsocket/SocketAddress.cpp
|
||||
../features/netsocket/InternetSocket.cpp
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
# UNIT TESTS
|
||||
####################
|
||||
|
||||
# Unit test suite name
|
||||
set(TEST_SUITE_NAME "features-netsocket-UDPSocket")
|
||||
|
||||
set(unittest-sources
|
||||
../features/netsocket/SocketAddress.cpp
|
||||
../features/netsocket/NetworkStack.cpp
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
# UNIT TESTS
|
||||
####################
|
||||
|
||||
# Unit test suite name
|
||||
set(TEST_SUITE_NAME "platform-CircularBuffer")
|
||||
|
||||
set(unittest-sources
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue