brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 78447e7 Raw
94 lines · plain
1# Test runner infrastructure for Clang-based tools. This configures the Clang2# test trees for use by Lit, and delegates to LLVM's lit test handlers.3#4# Note that currently we don't support stand-alone builds of Clang, you must5# be building Clang from within a combined LLVM+Clang checkout..6 7set(CLANG_TOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")8set(CLANG_TOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")9 10llvm_canonicalize_cmake_booleans(11  CLANG_TIDY_ENABLE_STATIC_ANALYZER12  CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS13  CLANG_PLUGIN_SUPPORT14  LLVM_INSTALL_TOOLCHAIN_ONLY15  )16 17configure_lit_site_cfg(18  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in19  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py20  MAIN_CONFIG21  ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py22  )23 24configure_lit_site_cfg(25  ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in26  ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py27  MAIN_CONFIG28  ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py29  )30 31set(CLANG_TOOLS_TEST_DEPS32  # For the clang-doc tests that emit bitcode files.33  llvm-bcanalyzer34 35  # Individual tools we test.36  clang-apply-replacements37  clang-change-namespace38  clang-doc39  clang-include-fixer40  clang-move41  clang-query42  clang-reorder-fields43  find-all-symbols44  modularize45  pp-trace46 47  # Unit tests48  ExtraToolsUnitTests49 50  # clang-tidy tests require it.51  clang-resource-headers52 53  clang-tidy54)55 56# Add lit test dependencies.57set(LLVM_UTILS_DEPS58  FileCheck count not split-file59)60foreach(dep ${LLVM_UTILS_DEPS})61  if(TARGET ${dep})62    list(APPEND CLANG_TOOLS_TEST_DEPS ${dep})63  endif()64endforeach()65 66if (NOT WIN32 OR NOT LLVM_LINK_LLVM_DYLIB)67  llvm_add_library(68      CTTestTidyModule69      MODULE clang-tidy/CTTestTidyModule.cpp70      PLUGIN_TOOL clang-tidy)71endif()72 73if(TARGET CTTestTidyModule)74    list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule)75    target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}")76    if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN))77      set(LLVM_LINK_COMPONENTS78        Support79      )80    endif()81endif()82 83add_lit_testsuite(check-clang-extra "Running clang-tools-extra/test"84   ${CMAKE_CURRENT_BINARY_DIR}85   DEPENDS ${CLANG_TOOLS_TEST_DEPS}86   )87 88add_lit_testsuites(CLANG-EXTRA ${CMAKE_CURRENT_SOURCE_DIR}89  DEPENDS ${CLANG_TOOLS_TEST_DEPS}90   SKIP "^clang-doc"91  )92 93add_subdirectory(clang-doc)94