2017-12-13 00:54:20 +08:00
|
|
|
# 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
|
2018-07-19 02:17:39 +08:00
|
|
|
clang
|
2018-07-19 04:10:43 +08:00
|
|
|
FileCheck
|
2017-12-13 00:54:20 +08:00
|
|
|
count
|
2018-02-27 04:56:45 +08:00
|
|
|
llvm-objdump
|
2017-12-13 00:54:20 +08:00
|
|
|
not
|
|
|
|
)
|
|
|
|
|
2019-11-01 05:00:22 +08:00
|
|
|
# If we don't already have Python 3, throw away any previous results and try to
|
|
|
|
# find it again.
|
|
|
|
set(DEBUGINFO_UNSET_PYTHON3 OFF)
|
|
|
|
if (PYTHON_VERSION_MAJOR LESS 3)
|
|
|
|
unset(PYTHONINTERP_FOUND CACHE)
|
|
|
|
unset(PYTHON_EXECUTABLE CACHE)
|
|
|
|
unset(PYTHON_LIBRARY CACHE)
|
|
|
|
unset(PYTHON_DLL CACHE)
|
|
|
|
unset(PYTHON_INCLUDE_DIR CACHE)
|
|
|
|
unset(PYTHON_VERSION_STRING CACHE)
|
|
|
|
unset(PYTHON_VERSION_MAJOR CACHE)
|
|
|
|
unset(PYTHON_VERSION_MINOR CACHE)
|
|
|
|
unset(PYTHON_VERSION_PATCH CACHE)
|
|
|
|
unset(PYTHONLIBS_VERSION_STRING CACHE)
|
|
|
|
|
|
|
|
# Try to find python3. If it doesn't exist, dexter tests can't run.
|
|
|
|
find_package(PythonInterp "3")
|
|
|
|
set(DEBUGINFO_UNSET_PYTHON3 ON)
|
|
|
|
endif()
|
2019-10-31 21:41:24 +08:00
|
|
|
|
2019-11-01 00:51:53 +08:00
|
|
|
if (NOT DEFINED PYTHON_EXECUTABLE)
|
|
|
|
message(FATAL_ERROR "Cannot run debuginfo-tests without python")
|
|
|
|
elseif(PYTHON_VERSION_MAJOR LESS 3)
|
|
|
|
message(FATAL_ERROR "Cannot run debuginfo-tests without python 3")
|
|
|
|
else()
|
|
|
|
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}
|
|
|
|
)
|
2019-11-01 05:00:22 +08:00
|
|
|
set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")
|
2019-11-01 00:51:53 +08:00
|
|
|
endif()
|
|
|
|
|
2019-11-01 05:00:22 +08:00
|
|
|
# Prevent the rest of llvm observing our secret python3-ness, if that wasn't
|
|
|
|
# what was originally found.
|
|
|
|
if (DEBUGINFO_UNSET_PYTHON3)
|
|
|
|
unset(PYTHONINTERP_FOUND CACHE)
|
|
|
|
unset(PYTHON_EXECUTABLE CACHE)
|
|
|
|
unset(PYTHON_LIBRARY CACHE)
|
|
|
|
unset(PYTHON_DLL CACHE)
|
|
|
|
unset(PYTHON_INCLUDE_DIR CACHE)
|
|
|
|
unset(PYTHON_VERSION_STRING CACHE)
|
|
|
|
unset(PYTHON_VERSION_MAJOR CACHE)
|
|
|
|
unset(PYTHON_VERSION_MINOR CACHE)
|
|
|
|
unset(PYTHON_VERSION_PATCH CACHE)
|
|
|
|
unset(PYTHONLIBS_VERSION_STRING CACHE)
|
|
|
|
endif()
|