-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[debuginfo-tests] Make debuginfo-tests work in a standard configuration.
Previously, debuginfo-tests was expected to be checked out into clang/test and then the tests would automatically run as part of check-clang. This is not a standard workflow for handling external projects, and it brings with it some serious drawbacks such as the inability to depend on things other than clang, which we will need going forward. The goal of this patch is to migrate towards a more standard workflow. To ease the transition for build bot maintainers, this patch tries not to break the existing workflow, but instead simply deprecate it to give maintainers a chance to update the build infrastructure. Differential Revision: https://reviews.llvm.org/D39605 llvm-svn: 317925
- Loading branch information
Zachary Turner
committed
Nov 10, 2017
1 parent
f59d071
commit 0f2ce11
Showing
26 changed files
with
153 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Debug Info tests. These 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. | ||
|
||
set(DEBUGINFO_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(DEBUGINFO_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
set(DEBUGINFO_TEST_DEPS | ||
clang | ||
llvm-config | ||
FileCheck | ||
count | ||
not | ||
) | ||
|
||
get_target_property(CLANG_SOURCE_DIR clang SOURCE_DIR) | ||
|
||
if (TARGET lld) | ||
set(DEBUGINFO_TESTS_HAS_LLD 1) | ||
list(APPEND DEBUGINFO_TEST_DEPS lld) | ||
get_target_property(LLD_SOURCE_DIR lld SOURCE_DIR) | ||
endif() | ||
|
||
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 | ||
) | ||
|
||
add_lit_testsuite(check-debuginfo "Running debug info integration tests" | ||
${CMAKE_CURRENT_BINARY_DIR} | ||
DEPENDS ${DEBUGINFO_TEST_DEPS} | ||
) | ||
|
||
set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# -*- Python -*- | ||
|
||
import os | ||
import platform | ||
import re | ||
import subprocess | ||
import tempfile | ||
|
||
import lit.formats | ||
import lit.util | ||
|
||
from lit.llvm import llvm_config | ||
from lit.llvm.subst import ToolSubst | ||
from lit.llvm.subst import FindTool | ||
|
||
# Configuration file for the 'lit' test runner. | ||
|
||
# name: The name of this test suite. | ||
config.name = 'debuginfo-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.suffixes = ['.c', '.cpp', '.m'] | ||
|
||
# excludes: A list of directories to exclude from the testsuite. The 'Inputs' | ||
# subdirectories contain auxiliary inputs for various tests in their parent | ||
# directories. | ||
config.excludes = ['Inputs'] | ||
|
||
# test_source_root: The root path where tests are located. | ||
config.test_source_root = os.path.join(config.debuginfo_tests_src_root, 'tests') | ||
|
||
# test_exec_root: The root path where tests should be run. | ||
config.test_exec_root = config.debuginfo_tests_obj_root | ||
|
||
llvm_config.use_default_substitutions() | ||
|
||
llvm_config.use_clang() | ||
|
||
if config.llvm_use_sanitizer: | ||
# Propagate path to symbolizer for ASan/MSan. | ||
llvm_config.with_system_environment( | ||
['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']) | ||
|
||
tool_dirs = [config.llvm_tools_dir] | ||
|
||
tools = [ | ||
ToolSubst('%test_debuginfo', command=os.path.join( | ||
config.llvm_src_root, 'utils', 'test_debuginfo.pl')), | ||
] | ||
|
||
llvm_config.add_tool_substitutions(tools, tool_dirs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@LIT_SITE_CFG_IN_HEADER@ | ||
|
||
import lit.util | ||
|
||
config.test_exec_root = "@CMAKE_BINARY_DIR@" | ||
|
||
config.llvm_src_root = "@LLVM_SOURCE_DIR@" | ||
config.llvm_obj_root = "@LLVM_BINARY_DIR@" | ||
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" | ||
config.llvm_libs_dir = "@LLVM_LIBS_DIR@" | ||
config.llvm_shlib_dir = "@SHLIBDIR@" | ||
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.has_lld = lit.util.pythonize_bool("@DEBUGINFO_TESTS_HAS_LLD@") | ||
config.host_triple = "@LLVM_HOST_TRIPLE@" | ||
config.target_triple = "@TARGET_TRIPLE@" | ||
config.host_arch = "@HOST_ARCH@" | ||
|
||
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" | ||
|
||
@LIT_SITE_CFG_IN_FOOTER@ | ||
|
||
# Let the main config do the real work. | ||
lit_config.load_config(config, "@DEBUGINFO_TESTS_SOURCE_DIR@/lit.cfg.py") |
2 changes: 1 addition & 1 deletion
2
debuginfo-tests/aggregate-indirect-arg.cpp → ...fo-tests/tests/aggregate-indirect-arg.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
debuginfo-tests/block_var.m → debuginfo-tests/tests/block_var.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters