mzeren-vmw added inline comments.

================
Comment at: cfe/trunk/unittests/Format/FormatTest.cpp:78
     EXPECT_EQ(Expected.str(), format(Code, Style));
     if (Style.Language == FormatStyle::LK_Cpp) {
       // Objective-C++ is a superset of C++, so everything checked for C++
----------------
MyDeveloperDay wrote:
> @ mzeren-vmw just a minor comment related to a change you made last year.
> 
> When FormatTest  fails, all we are told is that it fails on line 75,or 77 
> (currently in trunk its 48,49) for every failure, with so many test cases 
> written as "foo()" or "aaaaaa()" it can often be hard to pinpoint the exact 
> test failure.
> 
> If verifyFormat was given an additional default argument of `int line`
> 
> Then verifyFormat could be used via a macro
> 
> ```
> #define VERIFYFORMAT(expected,code,style)
>              verifyFormat(expected,code,style,__LINE__);
> ```
> 
> The line numbers could then be passed as an additional failure message to 
> gtest by passing the __LINE__ of the test location down.
> 
> ```
> void verifyFormat(llvm::StringRef Expected, llvm::StringRef Code,
>                     const FormatStyle &Style = getLLVMStyle(),int 
> line=__LINE__) {
>     EXPECT_EQ(Expected.str(), format(Expected, Style))
>         << "Expected code is not stable at " << line;
>     EXPECT_EQ(Expected.str(), format(Code, Style) << " at " << line;
> }
> ```
> 
> When the test fails we'd know the exact line of the test case that failed.
> 
> Also because of this, we get 2 failures for every failure, the second will 
> almost always fail as well if the first case does (from what I can tell), is 
> there anyway we can query the first failed result and not bother doing the 
> second if the first one failed?
All good points. I don't think I'll be able to get to this in the near future.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D42034/new/

https://reviews.llvm.org/D42034



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to