alexfh added inline comments.
================ Comment at: unittests/clang-tidy/ClangTidyTest.h:145 + + if (Options.FormatStyle) { + llvm::Expected<format::FormatStyle> Style = format::getStyle( ---------------- jdemeule wrote: > alexfh wrote: > > I wonder whether it's better to use lit for the tests that require > > formatting than to expand clang-tidy unit test utilities with > > runCheckAndFormatOnCode? What was the reason to use unit tests in this > > patch as opposed to lit tests? > Indeed, that a good question. > Personally, I found unit test easier to launch and debug than lit test and I > notice that it is not possible to made a unit test which react the same way > as clang-tidy. > When I wrote this test, I want it to react as in clang-tidy and for this I > try to call `cleanupAroundReplacements` in the test. > Adding formatting was more a side effect to have some sustainable and > comprehensive way to write test. > With more features clang-tidy gets the discrepancies between how unit tests work and how clang-tidy works become larger. I wouldn't like to mirror every clang-tidy feature in the code that supports unit tests. We should either expose more high-level APIs or use clang-tidy itself and lit tests. (I personally like the latter more, since lit tests tend to be closer to the real use cases and are easier to write and iterate on.) https://reviews.llvm.org/D43500 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits