-# Debug Info tests. These tests invoke clang to generate programs with
+# Cross project tests, for tests that require access to multiple projects across
+# LLVM (e.g. clang, lld and lldb).
+# The subset inside debuginfo-tests invoke clang to generate programs with
# various types of debug info, and then run those programs under a debugger
# such as GDB or LLDB to verify the results.
)
target_link_libraries(check-gdb-llvm-support PRIVATE LLVMSupport)
-set(DEBUGINFO_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-set(DEBUGINFO_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+set(CROSS_PROJECT_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(CROSS_PROJECT_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
-set(DEBUGINFO_TEST_DEPS
+set(CROSS_PROJECT_TEST_DEPS
clang
FileCheck
count
${LLVM_EXTERNAL_MLIR_SOURCE_DIR}/include
${LLVM_BINARY_DIR}/tools/mlir/include)
target_link_libraries(check-gdb-mlir-support PRIVATE MLIRIR)
- list(APPEND DEBUGINFO_TEST_DEPS check-gdb-mlir-support)
+ list(APPEND CROSS_PROJECT_TEST_DEPS check-gdb-mlir-support)
set(MLIR_SOURCE_DIR ${LLVM_EXTERNAL_MLIR_SOURCE_DIR})
endif()
if("compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS)
# llgdb-tests/asan.c and other asan* files.
if(TARGET asan)
- list(APPEND DEBUGINFO_TEST_DEPS asan)
+ list(APPEND CROSS_PROJECT_TEST_DEPS asan)
endif()
# llgdb-tests/safestack.c
if(TARGET safestack)
- list(APPEND DEBUGINFO_TEST_DEPS safestack)
+ list(APPEND CROSS_PROJECT_TEST_DEPS safestack)
endif()
endif()
# Many dexter tests depend on lldb.
if("lldb" IN_LIST LLVM_ENABLE_PROJECTS)
- list(APPEND DEBUGINFO_TEST_DEPS lldb lldb-server)
+ list(APPEND CROSS_PROJECT_TEST_DEPS lldb lldb-server)
endif()
# The Windows builder scripts pass -fuse-ld=lld.
if (WIN32)
- set(DEBUGINFO_TEST_DEPS ${DEBUGINFO_TEST_DEPS} lld)
+ list(APPEND CROSS_PROJECT_TEST_DEPS lld)
endif()
configure_lit_site_cfg(
add_lit_testsuite(check-debuginfo "Running cross-project tests"
${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${DEBUGINFO_TEST_DEPS}
+ DEPENDS ${CROSS_PROJECT_TEST_DEPS}
)
# Add check-debuginfo-* targets.
-add_lit_testsuites(DEBUGINFO ${CMAKE_CURRENT_SOURCE_DIR}
- DEPENDS ${DEBUGINFO_TEST_DEPS}
+add_lit_testsuites(CROSS_PROJECT ${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS ${CROSS_PROJECT_TEST_DEPS}
)
set_target_properties(check-debuginfo PROPERTIES FOLDER "Tests")
-# -*- Python -*-
-
import os
import platform
import re
# Configuration file for the 'lit' test runner.
# name: The name of this test suite.
-config.name = 'debuginfo-tests'
+config.name = 'cross-project-tests'
# testFormat: The test format to use to interpret tests.
-#
-# For now we require '&&' between commands, until they get globally killed and
-# the test runner updated.
config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
# suffixes: A list of file extensions to treat as test files.
config.excludes = ['Inputs']
# test_source_root: The root path where tests are located.
-config.test_source_root = config.debuginfo_tests_src_root
+config.test_source_root = config.cross_project_tests_src_root
# test_exec_root: The root path where tests should be run.
-config.test_exec_root = config.debuginfo_tests_obj_root
+config.test_exec_root = config.cross_project_tests_obj_root
llvm_config.use_default_substitutions()
tools = [
ToolSubst('%test_debuginfo', command=os.path.join(
- config.debuginfo_tests_src_root, 'debuginfo-tests',
+ config.cross_project_tests_src_root, 'debuginfo-tests',
'llgdb-tests', 'test_debuginfo.pl')),
ToolSubst("%llvm_src_root", config.llvm_src_root),
ToolSubst("%llvm_tools_dir", config.llvm_tools_dir),
# Produce dexter path, lldb path, and combine into the %dexter substitution
# for running a test.
-dexter_path = os.path.join(config.debuginfo_tests_src_root,
+dexter_path = os.path.join(config.cross_project_tests_src_root,
'debuginfo-tests', 'dexter', 'dexter.py')
dexter_test_cmd = '"{}" "{}" test'.format(sys.executable, dexter_path)
if lldb_path is not None:
lit.util.usePlatformSdkOnDarwin(config, lit_config)
-# available_features: REQUIRES/UNSUPPORTED lit commands look at this list.
if platform.system() == 'Darwin':
xcode_lldb_vers = subprocess.check_output(['xcrun', 'lldb', '--version']).decode("utf-8")
match = re.search('lldb-(\d+)', xcode_lldb_vers)
config.llvm_shlib_dir = "@SHLIBDIR@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@"
-config.debuginfo_tests_obj_root = "@DEBUGINFO_TESTS_BINARY_DIR@"
-config.debuginfo_tests_src_root = "@DEBUGINFO_TESTS_SOURCE_DIR@"
+config.cross_project_tests_obj_root = "@CROSS_PROJECT_TESTS_BINARY_DIR@"
+config.cross_project_tests_src_root = "@CROSS_PROJECT_TESTS_SOURCE_DIR@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.is_msvc = lit.util.pythonize_bool("@MSVC@")
lit.llvm.initialize(lit_config, config)
# Let the main config do the real work.
-lit_config.load_config(config, "@DEBUGINFO_TESTS_SOURCE_DIR@/lit.cfg.py")
+lit_config.load_config(config, "@CROSS_PROJECT_TESTS_SOURCE_DIR@/lit.cfg.py")