[PATCH] D52710: [clangd] Add "check-clangd" target

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 1 01:19:56 PDT 2018


hokein created this revision.
hokein added a reviewer: sammccall.
Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov, mgorny.

So we don't have to run "check-clang-tools" (which builds and tests all
clang tools) to verify our clangd-related change. It'd save waiting time for
clangd developers.

check-clangd (build ~1000 files, run ~340 tests) vs check-clang-tools (build
~3000 files, run ~1000 tests).

In the future, we probably want to add similar target for other
clang-tools (e.g. clang-tidy).


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52710

Files:
  test/CMakeLists.txt


Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -73,20 +73,38 @@
     )
 endif()
 
-set(llvm_utils
-  FileCheck count not
-  )
-
-foreach(t ${llvm_utils})
-  if(TARGET ${t})
-    list(APPEND CLANG_TOOLS_TEST_DEPS ${t})
-  endif()
-endforeach()
-
+macro(add_llvm_utils_deps deps)
+  set(llvm_utils
+      FileCheck count not
+      )
+  foreach(t ${llvm_utils})
+    if(TARGET ${t})
+      list(APPEND "${deps}" ${t})
+    endif()
+  endforeach()
+endmacro()
+
+add_llvm_utils_deps(CLANG_TOOLS_TEST_DEPS)
 add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"
   ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${CLANG_TOOLS_TEST_DEPS}
   ARGS ${CLANG_TOOLS_TEST_EXTRA_ARGS}
   )
 
 set_target_properties(check-clang-tools PROPERTIES FOLDER "Clang extra tools' tests")
+
+# Setup an individual test for building and testing clangd-only stuff.
+set(CLANGD_TEST_DEPS
+  clangd
+  ClangdTests
+  # clangd-related tools which don't have tests, add them to the test to make
+  # sure we don't introduce new changes that break their compilations.
+  clangd-indexer
+  dexp
+)
+add_llvm_utils_deps(CLANGD_TEST_DEPS)
+add_lit_testsuite(check-clangd "Running the Clangd regression tests"
+  ${CMAKE_CURRENT_BINARY_DIR}/Unit/clangd;${CMAKE_CURRENT_BINARY_DIR}/clangd
+  DEPENDS ${CLANGD_TEST_DEPS}
+)
+set_target_properties(check-clangd PROPERTIES FOLDER "Clangd tests")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52710.167680.patch
Type: text/x-patch
Size: 1481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181001/243b3fbb/attachment.bin>


More information about the cfe-commits mailing list