Skip to content

Commit eb26afb

Browse files
committed
Re-land "[lldb] Make the API, Shell and Unit tests independent lit test suites"
The commit got reverted because the tests were being run twice because of the overlapping test_exec_root. Pavel has since fixed that in 8248dd9.
1 parent 683590a commit eb26afb

File tree

5 files changed

+45
-34
lines changed

5 files changed

+45
-34
lines changed

lldb/test/API/CMakeLists.txt

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
add_custom_target(lldb-api-test-deps)
2+
add_dependencies(lldb-api-test-deps lldb-test-deps)
3+
4+
add_lit_testsuites(LLDB-API
5+
${CMAKE_CURRENT_SOURCE_DIR}
6+
DEPENDS lldb-api-test-deps)
7+
18
function(add_python_test_target name test_script args comment)
29
set(PYTHON_TEST_COMMAND
310
${Python3_EXECUTABLE}
@@ -153,39 +160,35 @@ string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_TEST_EXECUTAB
153160
string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_TEST_COMPILER "${LLDB_TEST_COMPILER}")
154161
string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_TEST_DSYMUTIL "${LLDB_TEST_DSYMUTIL}")
155162

156-
# Configure the API test suite.
157163
configure_lit_site_cfg(
158164
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
159165
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
160166
MAIN_CONFIG
161167
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py)
162168

163-
if (CMAKE_GENERATOR STREQUAL "Xcode")
164-
# Xcode does not get the auto-generated targets. We need to create
165-
# check-lldb-api manually.
166-
add_lit_testsuite(check-lldb-api "Running lldb api test suite"
167-
${CMAKE_CURRENT_BINARY_DIR}
168-
DEPENDS lldb-test-deps)
169-
endif()
170-
171169
# Targets for running the test suite on the different Apple simulators.
172170
add_lit_testsuite(check-lldb-simulator-ios
173171
"Running lldb test suite on the iOS simulator"
174172
${CMAKE_CURRENT_BINARY_DIR}
175173
PARAMS "lldb-run-with-simulator=ios"
176174
EXCLUDE_FROM_CHECK_ALL
177-
DEPENDS lldb-test-deps)
175+
DEPENDS lldb-api-test-deps)
178176

179177
add_lit_testsuite(check-lldb-simulator-watchos
180178
"Running lldb test suite on the watchOS simulator"
181179
${CMAKE_CURRENT_BINARY_DIR}
182180
PARAMS "lldb-run-with-simulator=watchos"
183181
EXCLUDE_FROM_CHECK_ALL
184-
DEPENDS lldb-test-deps)
182+
DEPENDS lldb-api-test-deps)
185183

186184
add_lit_testsuite(check-lldb-simulator-tvos
187185
"Running lldb test suite on the tvOS simulator"
188186
${CMAKE_CURRENT_BINARY_DIR}
189187
PARAMS "lldb-run-with-simulator=tvos"
190188
EXCLUDE_FROM_CHECK_ALL
191-
DEPENDS lldb-test-deps)
189+
DEPENDS lldb-api-test-deps)
190+
191+
add_lit_testsuite(check-lldb-api "Running lldb api test suite"
192+
${CMAKE_CURRENT_BINARY_DIR}
193+
EXCLUDE_FROM_CHECK_ALL
194+
DEPENDS lldb-api-test-deps)

lldb/test/CMakeLists.txt

+6-12
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,13 @@ configure_lit_site_cfg(
185185
MAIN_CONFIG
186186
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py)
187187

188-
add_lit_testsuites(LLDB
189-
${CMAKE_CURRENT_SOURCE_DIR}
190-
DEPENDS lldb-test-deps)
191-
192-
add_lit_testsuite(check-lldb-lit "Running lldb lit test suite"
188+
add_lit_testsuite(check-lldb "Running lldb lit test suite"
193189
${CMAKE_CURRENT_BINARY_DIR}
194-
DEPENDS lldb-test-deps)
195-
set_target_properties(check-lldb-lit PROPERTIES FOLDER "lldb tests")
196-
197-
add_custom_target(check-lldb)
198-
add_dependencies(check-lldb lldb-test-deps)
199-
set_target_properties(check-lldb PROPERTIES FOLDER "lldb misc")
200-
add_dependencies(check-lldb check-lldb-lit)
190+
DEPENDS
191+
lldb-api-test-deps
192+
lldb-shell-test-deps
193+
lldb-unit-test-deps)
194+
set_target_properties(check-lldb PROPERTIES FOLDER "lldb tests")
201195

202196
# Add a lit test suite that runs the API & shell test while capturing a
203197
# reproducer.

lldb/test/Shell/CMakeLists.txt

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Configure the Shell test suite.
1+
add_custom_target(lldb-shell-test-deps)
2+
add_dependencies(lldb-shell-test-deps lldb-test-deps)
3+
4+
add_lit_testsuites(LLDB-SHELL
5+
${CMAKE_CURRENT_SOURCE_DIR}
6+
DEPENDS lldb-shell-test-deps)
7+
28
configure_lit_site_cfg(
39
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
410
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
@@ -8,10 +14,7 @@ configure_file(
814
${CMAKE_CURRENT_SOURCE_DIR}/lit-lldb-init.in
915
${CMAKE_CURRENT_BINARY_DIR}/lit-lldb-init)
1016

11-
if (CMAKE_GENERATOR STREQUAL "Xcode")
12-
# Xcode does not get the auto-generated targets. We need to create
13-
# check-lldb-shell manually.
14-
add_lit_testsuite(check-lldb-shell "Running lldb shell test suite"
15-
${CMAKE_CURRENT_BINARY_DIR}
16-
DEPENDS lldb-test-deps)
17-
endif()
17+
add_lit_testsuite(check-lldb-shell "Running lldb shell test suite"
18+
${CMAKE_CURRENT_BINARY_DIR}
19+
EXCLUDE_FROM_CHECK_ALL
20+
DEPENDS lldb-shell-test-deps)

lldb/test/Unit/CMakeLists.txt

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
# Configure the Unit test suite.
1+
add_custom_target(lldb-unit-test-deps)
2+
add_dependencies(lldb-unit-test-deps lldb-test-deps)
3+
4+
add_lit_testsuites(LLDB-UNIT
5+
${CMAKE_CURRENT_SOURCE_DIR}
6+
DEPENDS lldb-unit-test-deps)
7+
28
configure_lit_site_cfg(
39
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
410
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
511
MAIN_CONFIG
612
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py)
713

14+
add_lit_testsuite(check-lldb-unit "Running lldb unit test suite"
15+
${CMAKE_CURRENT_BINARY_DIR}
16+
EXCLUDE_FROM_CHECK_ALL
17+
DEPENDS lldb-unit-test-deps)

lldb/unittests/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
add_custom_target(LLDBUnitTests)
22
set_target_properties(LLDBUnitTests PROPERTIES FOLDER "lldb tests")
3-
add_dependencies(lldb-test-deps LLDBUnitTests)
3+
4+
add_dependencies(lldb-unit-test-deps LLDBUnitTests)
45

56
include_directories(${LLDB_SOURCE_ROOT})
67
include_directories(${LLDB_PROJECT_ROOT}/unittests)

0 commit comments

Comments
 (0)