This is an archive of the discontinued LLVM Phabricator instance.

Add a test checking clang-tidy can find libc++ on Mac
ClosedPublic

Authored by ilya-biryukov on Nov 9 2018, 6:51 AM.

Diff Detail

Event Timeline

ilya-biryukov created this revision.Nov 9 2018, 6:51 AM
sammccall added inline comments.Nov 12 2018, 1:28 AM
test/clang-tidy/clang-tidy-mac-libcxx.cpp
12

should this be "command":"clang++"... with clang++ on the PATH?

14

This should check a diagnostic rather than rely on the error code, I think

  • Updated the test
ilya-biryukov marked an inline comment as done.Nov 12 2018, 1:42 AM
ilya-biryukov added inline comments.
test/clang-tidy/clang-tidy-mac-libcxx.cpp
12

Both the relative and the absolute path should work, but cmake produces absolute paths. Hence the test.

14

Done. We rely on the absence of a diagnostic (the unresolved error for vector), error-code seemed like a simpler way to do this.

sammccall accepted this revision.Nov 12 2018, 1:47 AM
sammccall added inline comments.
test/clang-tidy/clang-tidy-mac-libcxx.cpp
12

Is there a test for the other case? (In the clang repo rather than here is fine)

14

I think emitting a diagnostic would make this a much more robust test, but up to you.

This revision is now accepted and ready to land.Nov 12 2018, 1:47 AM
ilya-biryukov marked an inline comment as done.Nov 12 2018, 1:53 AM
ilya-biryukov added inline comments.
test/clang-tidy/clang-tidy-mac-libcxx.cpp
12

No, will add one in the clang repo.

ilya-biryukov marked an inline comment as done.
  • Check for a diagnostic inside the found library
  • Check with a clang-tidy warning instead of a clang error
This revision was automatically updated to reflect the committed changes.