diff options
author | Felipe de Azevedo Piovezan <fpiovezan@apple.com> | 2022-08-23 11:11:06 -0400 |
---|---|---|
committer | Felipe de Azevedo Piovezan <fpiovezan@apple.com> | 2022-08-26 06:52:40 -0400 |
commit | bb26ebb4d18c1877cc6fd17aa803609abeb95096 (patch) | |
tree | bd94fd6d98b126c955a187e8fb7ec7e6542934ad /lldb/utils | |
parent | 88c7b16bede8a0b070fd74f05e0ae88833629e5b (diff) | |
download | llvm-bb26ebb4d18c1877cc6fd17aa803609abeb95096.zip llvm-bb26ebb4d18c1877cc6fd17aa803609abeb95096.tar.gz llvm-bb26ebb4d18c1877cc6fd17aa803609abeb95096.tar.bz2 |
[lldb] Fix dotest argument order
When running LLDB API tests, a user can override test arguments with
LLDB_TEST_USER_ARGS. However, these flags used to be concatenated with a
CMake-derived variable LLDB_TEST_COMMON_ARGS, as below:
```
set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}
CACHE INTERNAL STRING)
```
This is problematic, because LLDB_TEST_COMMON_ARGS must be processed
first, while LLDB_TEST_USER_ARGS args must be processed last, so that
user overrides are respected. Currently, if a user attempts to override
one of the "inferred" flags, the user's request is ignored. This is the
case, for example, with `--libcxx-include-dir` and
`--libcxx-library-dir`. Both flags are needed by the greendragon bots.
This commit removes the concatenation above, keeping the two original
variables throughout the entire flow, processing the user's flag last.
The variable LLDB_TEST_COMMON_ARGS needs to be a CACHE property, but it
is modified throughout the CMake file with `set` or `list` or `string`
commands, which don't work with properties. As such, a temporary
variable `LLDB_TEST_COMMON_ARGS_VAR` is created.
This was tested locally by invoking CMake with:
-DLLDB_TEST_USER_ARGS="--libcxx-include-dir=blah --libcxx-library-dir=blah2"
and checking that tests failed appropriately.
Differential Revision: https://reviews.llvm.org/D132642
Diffstat (limited to 'lldb/utils')
-rw-r--r-- | lldb/utils/lldb-dotest/CMakeLists.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/utils/lldb-dotest/CMakeLists.txt b/lldb/utils/lldb-dotest/CMakeLists.txt index aab3f36..9be57f6 100644 --- a/lldb/utils/lldb-dotest/CMakeLists.txt +++ b/lldb/utils/lldb-dotest/CMakeLists.txt @@ -3,7 +3,8 @@ add_custom_target(lldb-dotest) add_dependencies(lldb-dotest lldb-test-depends) set_target_properties(lldb-dotest PROPERTIES FOLDER "lldb utils") -get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY) +get_property(LLDB_TEST_USER_ARGS GLOBAL PROPERTY LLDB_TEST_USER_ARGS_PROPERTY) +get_property(LLDB_TEST_COMMON_ARGS GLOBAL PROPERTY LLDB_TEST_COMMON_ARGS_PROPERTY) set(LLDB_LIBS_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}") llvm_canonicalize_cmake_booleans( @@ -12,7 +13,8 @@ llvm_canonicalize_cmake_booleans( set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}") set(vars - LLDB_DOTEST_ARGS + LLDB_TEST_COMMON_ARGS + LLDB_TEST_USER_ARGS LLDB_SOURCE_DIR LLDB_FRAMEWORK_DIR LLDB_TEST_BUILD_DIRECTORY |