summaryrefslogtreecommitdiffstats
path: root/debuginfo-tests/CMakeLists.txt
blob: 0ac48da5fbc9c34f56d4ef6b05e0d284d14a89c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# 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
  FileCheck
  count
  llvm-objdump
  not
  )

# Wipe, uh, previous results
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")
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}
    )
  set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests") 
endif()

# Prevent the rest of llvm observing our secret python3-ness
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)
OpenPOWER on IntegriCloud