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.

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
11

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

13

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
11

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

13

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
11

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

13

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
11

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.