This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add "check-clangd" target
ClosedPublic

Authored by hokein on Oct 1 2018, 1:19 AM.

Details

Summary

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).

Diff Detail

Repository
rL LLVM

Event Timeline

hokein created this revision.Oct 1 2018, 1:19 AM

Thanks for doing this!
Sorry for the dumb questions, I don't get cmake.

test/CMakeLists.txt
36 ↗(On Diff #167680)

can we add all of clangd to this list with a loop, instead of duplicating?

76 ↗(On Diff #167680)

Conversely, I'd consider just expanding these out into each of the dep lists rather than keeping two levels of indirection here.

107 ↗(On Diff #167680)

Is /Unit/ really right?

hokein marked an inline comment as done.Oct 1 2018, 1:49 AM
hokein added inline comments.
test/CMakeLists.txt
36 ↗(On Diff #167680)

We could do this, or alternatively we can remove all clangd-related binaries, and add check-clangd target. The only difference is that the output will change a bit, like below, I think this is not a big deal, WDYT?

[0/2] Running the Clangd regression tests
Testing Time: 2.78s
  Expected Passes    : 343
  Unsupported Tests  : 1
[1/2] Running the Clang extra tools' regression tests
Testing Time: 4.08s
  Expected Passes    : 1001
  Unsupported Tests  : 2
107 ↗(On Diff #167680)

Yes, indeed. It is used for running unittest (we have lit configuration file in test/Unit/ directory).

sammccall accepted this revision.Oct 1 2018, 2:23 AM

Awesome! Please do remove that duplication if it's easy.

test/CMakeLists.txt
36 ↗(On Diff #167680)

Yes, that looks great!

This revision is now accepted and ready to land.Oct 1 2018, 2:23 AM
hokein updated this revision to Diff 167689.Oct 1 2018, 2:55 AM
hokein marked 2 inline comments as done.

Remove clangd-binary dep in check-clang-tools, and use check-clangd.

hokein added inline comments.Oct 1 2018, 2:56 AM
test/CMakeLists.txt
76 ↗(On Diff #167680)

Ah, I missed this comment. It seems that there is no elegant way to expand these to CLANG_TOOLS_TEST_DEPS and CLANGD_TOOLS_TEST_DEPS, we have to repeat the code twice. So I'd prefer using macro to eliminate code duplication.

sammccall added inline comments.Oct 1 2018, 3:01 AM
test/CMakeLists.txt
76 ↗(On Diff #167680)

Right, that was my suggestion: instead of 13 lines of macros, to add "FileCheck count not" twice, we just write it twice. It won't change often, and if it does there's no reason to assume you'd want them in sync.

hokein updated this revision to Diff 167692.Oct 1 2018, 3:27 AM

Remove llvm util dependencies (we move it to add_lit_target().

sammccall accepted this revision.Oct 1 2018, 3:30 AM

Awesome, thanks!

This is awesome! Can't wait for it to land!

hokein added a comment.Oct 1 2018, 5:53 AM

Need someone stamps on https://reviews.llvm.org/D52713 before landing this patch :)

This revision was automatically updated to reflect the committed changes.