File tree Expand file tree Collapse file tree 8 files changed +12
-27
lines changed Expand file tree Collapse file tree 8 files changed +12
-27
lines changed Original file line number Diff line number Diff line change @@ -147,11 +147,17 @@ foreach(testfile ${unittest-file-list})
147
147
# Get source files
148
148
include ("${testfile} " )
149
149
150
- if (TEST_SUITE_NAME )
151
- set (TEST_SUITES ${TEST_SUITES} ${TEST_SUITE_NAME} )
152
- else ()
153
- message (FATAL_ERROR "No TEST_SUITE_NAME found in test file. Add it to ${testfile} ." )
154
- endif ()
150
+ get_filename_component (TEST_SUITE_DIR ${testfile} DIRECTORY )
151
+
152
+ file (RELATIVE_PATH
153
+ TEST_SUITE_NAME # output
154
+ ${PROJECT_SOURCE_DIR} # root
155
+ ${TEST_SUITE_DIR} #abs dirpath
156
+ )
157
+
158
+ string (REGEX REPLACE "/|\\\\ " "-" TEST_SUITE_NAME ${TEST_SUITE_NAME} )
159
+
160
+ set (TEST_SUITES ${TEST_SUITES} ${TEST_SUITE_NAME} )
155
161
156
162
set (LIBS_TO_BE_LINKED gmock_main )
157
163
@@ -178,7 +184,7 @@ foreach(testfile ${unittest-file-list})
178
184
# Link the executable with the libraries.
179
185
target_link_libraries (${TEST_SUITE_NAME} ${LIBS_TO_BE_LINKED} )
180
186
181
- add_test (NAME "${TEST_SUITE_NAME} UnitTests " COMMAND ${TEST_SUITE_NAME} )
187
+ add_test (NAME "${TEST_SUITE_NAME} " COMMAND ${TEST_SUITE_NAME} )
182
188
183
189
# Append test build directory to list
184
190
list (APPEND BUILD_DIRECTORIES "./CMakeFiles/${TEST_SUITE_NAME} .dir" )
Original file line number Diff line number Diff line change 3
3
# UNIT TESTS
4
4
####################
5
5
6
- # Unit test suite name
7
- set (TEST_SUITE_NAME "cellular-framework-AT-AT_CellularBase" )
8
-
9
6
# Add test specific include paths
10
7
set (unittest-includes ${unittest-includes}
11
8
features/cellular/framework/AT/AT_CellularBase
Original file line number Diff line number Diff line change 3
3
# UNIT TESTS
4
4
####################
5
5
6
- # Unit test suite name
7
- set (TEST_SUITE_NAME "cellular-framework-common-util" )
8
-
9
6
# Add test specific include paths
10
7
set (unittest-includes ${unittest-includes}
11
8
features/cellular/framework/common/util
Original file line number Diff line number Diff line change 3
3
# UNIT TESTS
4
4
####################
5
5
6
- # Unit test suite name
7
- set (TEST_SUITE_NAME "features-netsocket-InternetSocket" )
8
-
9
6
set (unittest-sources
10
7
../features/netsocket/SocketAddress.cpp
11
8
../features/netsocket/NetworkStack.cpp
Original file line number Diff line number Diff line change 3
3
# UNIT TESTS
4
4
####################
5
5
6
- # Unit test suite name
7
- set (TEST_SUITE_NAME "features-netsocket-NetworkInterface" )
8
-
9
6
# Source files
10
7
set (unittest-sources
11
8
../features/netsocket/NetworkInterface.cpp
Original file line number Diff line number Diff line change 3
3
# UNIT TESTS
4
4
####################
5
5
6
- # Unit test suite name
7
- set (TEST_SUITE_NAME "features-netsocket-TCPSocket" )
8
-
9
6
set (unittest-sources
10
7
../features/netsocket/SocketAddress.cpp
11
8
../features/netsocket/InternetSocket.cpp
Original file line number Diff line number Diff line change 3
3
# UNIT TESTS
4
4
####################
5
5
6
- # Unit test suite name
7
- set (TEST_SUITE_NAME "features-netsocket-UDPSocket" )
8
-
9
6
set (unittest-sources
10
7
../features/netsocket/SocketAddress.cpp
11
8
../features/netsocket/NetworkStack.cpp
Original file line number Diff line number Diff line change 3
3
# UNIT TESTS
4
4
####################
5
5
6
- # Unit test suite name
7
- set (TEST_SUITE_NAME "platform-CircularBuffer" )
8
-
9
6
set (unittest-sources
10
7
)
11
8
You can’t perform that action at this time.
0 commit comments