diff --git a/cross-project-tests/CMakeLists.txt b/cross-project-tests/CMakeLists.txt --- a/cross-project-tests/CMakeLists.txt +++ b/cross-project-tests/CMakeLists.txt @@ -1,4 +1,6 @@ -# 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. @@ -9,10 +11,10 @@ ) 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 @@ -30,28 +32,28 @@ ${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( @@ -63,12 +65,12 @@ 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") diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py --- a/cross-project-tests/lit.cfg.py +++ b/cross-project-tests/lit.cfg.py @@ -1,5 +1,3 @@ -# -*- Python -*- - import os import platform import re @@ -15,12 +13,9 @@ # 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. @@ -32,16 +27,16 @@ 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), @@ -99,7 +94,7 @@ # 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: @@ -146,7 +141,6 @@ 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) diff --git a/cross-project-tests/lit.site.cfg.py.in b/cross-project-tests/lit.site.cfg.py.in --- a/cross-project-tests/lit.site.cfg.py.in +++ b/cross-project-tests/lit.site.cfg.py.in @@ -9,8 +9,8 @@ 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@") @@ -33,4 +33,4 @@ 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")