Skip to content

Commit bd14d6e

Browse files
committed
[lldb] Hoist -s (trace directory) argument out of LLDB_TEST_COMMON_ARGS (NFC)
Give the trace directory argument its own variable (LLDB_TEST_TRACE_DIRECTORY) so that we can configure it in lit.site.cfg.py if we so desire.
1 parent afcf9c4 commit bd14d6e

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

lldb/test/API/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ set(LLDB_TEST_USER_ARGS
3636
# hash of filename and .text section, there *will* be conflicts inside
3737
# the build directory.
3838
set(LLDB_TEST_COMMON_ARGS
39-
-s
40-
${CMAKE_BINARY_DIR}/lldb-test-traces
4139
-S nm
4240
-u CXXFLAGS
4341
-u CFLAGS
4442
)
4543

44+
# Configure the traces directory.
45+
set(LLDB_TEST_TRACE_DIRECTORY "${PROJECT_BINARY_DIR}/lldb-test-traces" CACHE PATH "The test traces directory.")
46+
4647
# Set the path to the default lldb test executable.
4748
set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}")
4849

@@ -141,6 +142,7 @@ if(LLDB_BUILT_STANDALONE)
141142
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_SOURCE_DIR "${LLDB_SOURCE_DIR}")
142143
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_FRAMEWORK_DIR "${LLDB_FRAMEWORK_DIR}")
143144
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_BUILD_DIRECTORY "${LLDB_TEST_BUILD_DIRECTORY}")
145+
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_TRACE_DIRECTORY "${LLDB_TEST_TRACE_DIRECTORY}")
144146
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_EXECUTABLE "${LLDB_TEST_EXECUTABLE}")
145147
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_COMPILER "${LLDB_TEST_COMPILER}")
146148
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_DSYMUTIL "${LLDB_TEST_DSYMUTIL}")
@@ -170,6 +172,7 @@ endif()
170172
string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
171173
string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_SOURCE_DIR "${LLDB_SOURCE_DIR}")
172174
string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_TEST_BUILD_DIRECTORY "${LLDB_TEST_BUILD_DIRECTORY}")
175+
string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_TEST_TRACE_DIRECTORY "${LLDB_TEST_TRACE_DIRECTORY}")
173176
string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_TEST_EXECUTABLE "${LLDB_TEST_EXECUTABLE}")
174177
string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_TEST_COMPILER "${LLDB_TEST_COMPILER}")
175178
string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_TEST_DSYMUTIL "${LLDB_TEST_DSYMUTIL}")

lldb/test/API/lit.cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ def delete_module_cache(path):
177177
if is_configured('lldb_build_directory'):
178178
dotest_cmd += ['--build-dir', config.lldb_build_directory]
179179

180+
if is_configured('lldb_trace_directory'):
181+
dotest_cmd += ['-s', config.lldb_trace_directory]
182+
180183
if is_configured('lldb_module_cache'):
181184
delete_module_cache(config.lldb_module_cache)
182185
dotest_cmd += ['--lldb-module-cache-dir', config.lldb_module_cache]

lldb/test/API/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ config.shared_libs = @LLVM_ENABLE_SHARED_LIBS@
1919
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
2020
config.target_triple = "@TARGET_TRIPLE@"
2121
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
22+
config.lldb_trace_directory = "@LLDB_TEST_TRACE_DIRECTORY@"
2223
config.lldb_reproducer_directory = os.path.join("@LLDB_TEST_BUILD_DIRECTORY@", "reproducers")
2324
config.python_executable = "@Python3_EXECUTABLE@"
2425
config.dotest_args_str = "@LLDB_DOTEST_ARGS@"

lldb/utils/lldb-dotest/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ if(LLDB_BUILT_STANDALONE)
2323
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_SOURCE_DIR_CONFIGURED "${LLDB_SOURCE_DIR}")
2424
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_FRAMEWORK_DIR_CONFIGURED "${LLDB_FRAMEWORK_DIR}")
2525
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_BUILD_DIRECTORY_CONFIGURED "${LLDB_TEST_BUILD_DIRECTORY}")
26+
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_TRACE_DIRECTORY_CONFIGURED "${LLDB_TEST_TRACE_DIRECTORY}")
2627
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
2728
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
2829
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
@@ -37,6 +38,7 @@ if(LLDB_BUILT_STANDALONE)
3738
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_SOURCE_DIR_CONFIGURED "${LLDB_SOURCE_DIR}")
3839
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_FRAMEWORK_DIR_CONFIGURED "${LLDB_FRAMEWORK_DIR}")
3940
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_BUILD_DIRECTORY_CONFIGURED "${LLDB_TEST_BUILD_DIRECTORY}")
41+
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_TRACE_DIRECTORY_CONFIGURED "${LLDB_TEST_TRACE_DIRECTORY}")
4042
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
4143
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
4244
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
@@ -50,6 +52,7 @@ if(LLDB_BUILT_STANDALONE)
5052
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_SOURCE_DIR_CONFIGURED "${LLDB_SOURCE_DIR}")
5153
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_FRAMEWORK_DIR_CONFIGURED "${LLDB_FRAMEWORK_DIR}")
5254
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_BUILD_DIRECTORY_CONFIGURED "${LLDB_TEST_BUILD_DIRECTORY}")
55+
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_TRACE_DIRECTORY_CONFIGURED "${LLDB_TEST_TRACE_DIRECTORY}")
5356
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
5457
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
5558
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
@@ -71,6 +74,7 @@ elseif(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
7174
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_SOURCE_DIR_CONFIGURED "${LLDB_SOURCE_DIR}")
7275
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_FRAMEWORK_DIR_CONFIGURED "${LLDB_FRAMEWORK_DIR}")
7376
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_BUILD_DIRECTORY_CONFIGURED "${LLDB_TEST_BUILD_DIRECTORY}")
77+
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_TRACE_DIRECTORY_CONFIGURED "${LLDB_TEST_TRACE_DIRECTORY}")
7478
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
7579
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
7680
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
@@ -89,6 +93,7 @@ else()
8993
set(LLDB_SOURCE_DIR_CONFIGURED "${LLDB_SOURCE_DIR}")
9094
set(LLDB_FRAMEWORK_DIR_CONFIGURED "${LLDB_FRAMEWORK_DIR}")
9195
set(LLDB_TEST_BUILD_DIRECTORY_CONFIGURED "${LLDB_TEST_BUILD_DIRECTORY}")
96+
set(LLDB_TEST_TRACE_DIRECTORY_CONFIGURED "${LLDB_TEST_TRACE_DIRECTORY}")
9297
set(LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
9398
set(LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
9499
set(LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")

lldb/utils/lldb-dotest/lldb-dotest.in

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import subprocess
33
import sys
44

55
dotest_path = '@LLDB_SOURCE_DIR_CONFIGURED@/test/API/dotest.py'
6-
build_dir = '@LLDB_TEST_BUILD_DIRECTORY_CONFIGURED@'
76
dotest_args_str = '@LLDB_DOTEST_ARGS_CONFIGURED@'
87
arch = '@LLDB_TEST_ARCH@'
98
executable = '@LLDB_TEST_EXECUTABLE_CONFIGURED@'
@@ -12,9 +11,11 @@ dsymutil = '@LLDB_TEST_DSYMUTIL_CONFIGURED@'
1211
filecheck = '@LLDB_TEST_FILECHECK_CONFIGURED@'
1312
yaml2obj = '@LLDB_TEST_YAML2OBJ_CONFIGURED@'
1413
server = '@LLDB_TEST_SERVER_CONFIGURED@'
15-
lldb_libs_dir = "@LLDB_LIBS_DIR_CONFIGURED@"
16-
lldb_framework_dir = "@LLDB_FRAMEWORK_DIR_CONFIGURED@"
14+
lldb_build_dir = '@LLDB_TEST_BUILD_DIRECTORY_CONFIGURED@'
1715
lldb_build_intel_pt = "@LLDB_BUILD_INTEL_PT@"
16+
lldb_framework_dir = "@LLDB_FRAMEWORK_DIR_CONFIGURED@"
17+
lldb_libs_dir = "@LLDB_LIBS_DIR_CONFIGURED@"
18+
lldb_trace_dir = '@LLDB_TEST_TRACE_DIRECTORY_CONFIGURED@'
1819

1920
if __name__ == '__main__':
2021
wrapper_args = sys.argv[1:]
@@ -23,7 +24,8 @@ if __name__ == '__main__':
2324
cmd = [sys.executable, dotest_path]
2425
cmd.extend(['--arch', arch])
2526
cmd.extend(dotest_args)
26-
cmd.extend(['--build-dir', build_dir])
27+
cmd.extend(['-s', lldb_trace_dir])
28+
cmd.extend(['--build-dir', lldb_build_dir])
2729
cmd.extend(['--executable', executable])
2830
cmd.extend(['--compiler', compiler])
2931
cmd.extend(['--dsymutil', dsymutil])

0 commit comments

Comments
 (0)