1 add_custom_target(LLDBUnitTests)
2 set_target_properties(LLDBUnitTests PROPERTIES FOLDER "lldb tests")
4 add_dependencies(lldb-unit-test-deps LLDBUnitTests)
6 include_directories(${LLDB_SOURCE_ROOT})
7 include_directories(${LLDB_PROJECT_ROOT}/unittests)
9 if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)
10 add_compile_options("-Wno-suggest-override")
13 function(add_lldb_unittest test_name)
14 cmake_parse_arguments(ARG
17 "LINK_LIBS;LINK_COMPONENTS"
20 if (NOT ${test_name} MATCHES "Tests$")
21 message(FATAL_ERROR "Unit test name must end with 'Tests' for lit to find it.")
24 list(APPEND LLVM_LINK_COMPONENTS ${ARG_LINK_COMPONENTS})
26 add_unittest(LLDBUnitTests
28 ${ARG_UNPARSED_ARGUMENTS}
34 COMMAND "${CMAKE_COMMAND}" -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/Inputs)
36 target_link_libraries(${test_name} PRIVATE ${ARG_LINK_LIBS})
39 function(add_unittest_inputs test_name inputs)
40 foreach (INPUT ${inputs})
44 COMMAND "${CMAKE_COMMAND}" -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Inputs/${INPUT} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/Inputs
45 COMMENT "Copying ${INPUT} to binary directory.")
49 add_subdirectory(TestingSupport)
50 if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
51 # FIXME: APITests.exe is not a valid googletest binary.
54 add_subdirectory(Breakpoint)
55 add_subdirectory(Core)
56 add_subdirectory(DataFormatter)
57 add_subdirectory(Disassembler)
58 add_subdirectory(Editline)
59 add_subdirectory(Expression)
60 add_subdirectory(Host)
61 add_subdirectory(Interpreter)
62 add_subdirectory(Instruction)
63 add_subdirectory(Language)
64 add_subdirectory(ObjectFile)
65 add_subdirectory(Platform)
66 add_subdirectory(Process)
67 add_subdirectory(ScriptInterpreter)
68 add_subdirectory(Signals)
69 add_subdirectory(Symbol)
70 add_subdirectory(SymbolFile)
71 add_subdirectory(Target)
72 add_subdirectory(tools)
73 add_subdirectory(UnwindAssembly)
74 add_subdirectory(Utility)
75 add_subdirectory(Thread)
77 if(LLDB_CAN_USE_DEBUGSERVER AND LLDB_TOOL_DEBUGSERVER_BUILD AND NOT LLDB_USE_SYSTEM_DEBUGSERVER)
78 add_subdirectory(debugserver)