[PATCH] D56116: [gn build] Make `ninja check-clang` also run Clang's unit tests

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 27 17:07:01 PST 2018


thakis created this revision.
thakis added a reviewer: phosek.
Herald added a subscriber: arphaman.

Also add a build file for clang/lib/ASTMatchers/Dynamic, which is only needed by tests (and clang/tools/extra).

With this, the build files for //clang are complete.

-

I'm sending this out before it's 100% done. Open questions:

- If a new unit test binary gets added to the CMake build, it's easy to miss that in the GN build and the only effect is that the tests silently don't get run. I want to make the sync script check that the number of unit test binaries match somehow.
- target_out_dir is kind of a weird place to put the tests: out/gn/obj/clang/unittests/Format/FormatTests (etc). The CMake build for an SVN checkout puts them at ./tools/clang/unittests/Format/FormatTests which is weird too (I haven't checked the CMake build for a git build yet; that'd be interesting). Maybe putting them all in out/gn/bin/unittests could work? It looks like the unit test binary names try to be unique across all LLVM projects – but it'd be a pretty big difference from a CMake build, so I don't like that. out/gn/bin/unittests/{lld,clang,llvm}/FormatTests could work, but the every project would need its own test() macro, which is kind of lame too. So maybe it's fine as is, but it makes it pretty annoying to run test binaries manually, so I kind of feel it's not fine as is.
- Probably want a test() macro.
- The bigobj FIXME is silly. We should pass /bigobj globally. For the CMake build too.


https://reviews.llvm.org/D56116

Files:
  llvm/utils/gn/secondary/clang/lib/ASTMatchers/Dynamic/BUILD.gn
  llvm/utils/gn/secondary/clang/test/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/AST/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/ASTMatchers/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/ASTMatchers/Dynamic/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Analysis/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Basic/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/CodeGen/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/CrossTU/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Driver/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Format/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Frontend/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Index/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Lex/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Rename/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Rewrite/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Sema/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/StaticAnalyzer/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/Tooling/BUILD.gn
  llvm/utils/gn/secondary/clang/unittests/libclang/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56116.179592.patch
Type: text/x-patch
Size: 19422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181228/3f30a08f/attachment-0001.bin>


More information about the cfe-commits mailing list