summaryrefslogtreecommitdiffstats
path: root/lldb/test/API
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-10-24 10:54:48 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2019-10-24 10:58:22 -0700
commit0c798aa4483e103e67231c279aed00cd16154e33 (patch)
tree34af3ae1261458ae6b77c2e2c931939d6e5698d8 /lldb/test/API
parent6c5898ef79f50c9310661d3a860de0091961038a (diff)
downloadbcm5719-llvm-0c798aa4483e103e67231c279aed00cd16154e33.tar.gz
bcm5719-llvm-0c798aa4483e103e67231c279aed00cd16154e33.zip
[CMake] Split logic across test suite subdirectories (NFC)
The top-level CMake file in the test directory can be simplified by moving relevant configuration options into the corresponding subdirectories. Doing so makes it easier to understand what CMake options are needed by the different test suites. Differential revision: https://reviews.llvm.org/D69394
Diffstat (limited to 'lldb/test/API')
-rw-r--r--lldb/test/API/CMakeLists.txt39
1 files changed, 34 insertions, 5 deletions
diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt
index 4f787d21fd3..0708e804f49 100644
--- a/lldb/test/API/CMakeLists.txt
+++ b/lldb/test/API/CMakeLists.txt
@@ -125,9 +125,38 @@ if(CMAKE_HOST_APPLE)
endif()
endif()
-set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})
-set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS})
+set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS} CACHE INTERNAL STRING)
+set(dotest_args_replacement ${LLVM_BUILD_MODE})
+
+if(LLDB_BUILT_STANDALONE)
+ # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder.
+ string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})
+ string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
+
+ # Remaining ones must be paths to the provided LLVM build-tree.
+ if(LLVM_CONFIGURATION_TYPES)
+ # LLDB uses single-config; LLVM multi-config; pick one and prefer Release types.
+ # Otherwise, if both use multi-config the default is fine.
+ if(NOT CMAKE_CONFIGURATION_TYPES)
+ if(RelWithDebInfo IN_LIST LLVM_CONFIGURATION_TYPES)
+ set(dotest_args_replacement RelWithDebInfo)
+ elseif(Release IN_LIST LLVM_CONFIGURATION_TYPES)
+ set(dotest_args_replacement Release)
+ else()
+ list(GET LLVM_CONFIGURATION_TYPES 0 dotest_args_replacement)
+ endif()
+ endif()
+ else()
+ # Common case: LLVM used a single-configuration generator like Ninja.
+ set(dotest_args_replacement ".")
+ endif()
+endif()
+
+string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
-# This will add LLDB's test dependencies to the dependencies for check-all and
-# include them in the test-depends target.
-set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS})
+# Configure the API test suite.
+configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
+ MAIN_CONFIG
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py)
OpenPOWER on IntegriCloud