Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/clang-tidy/readability-braces-around-statements-assert-failure.cpp | ||
---|---|---|
13 ↗ | (On Diff #47617) | Can you further reduce the test case so it still causes a crash, but doesn't generate so many compilation errors? The problem with matching compilation errors in clang-tidy tests is that a change in Clang parser can break clang-tidy tests. The more errors you verify, the higher the chance of this kind of a breakage. If we need to verify clang errors, we should keep their number minimal. |
test/clang-tidy/readability-braces-around-statements-assert-failure.cpp | ||
---|---|---|
13 ↗ | (On Diff #47617) | Indeed, this is the minimal test case. Is there a way to modify the test script to ignore message of compilation errors? |
test/clang-tidy/readability-braces-around-statements-assert-failure.cpp | ||
---|---|---|
13 ↗ | (On Diff #47617) | Interesting. Does creduce fail to further reduce the test? As for ignoring errors, it's rather rarely needed in tests. Usually, we need the reverse: to ensure tests compile without errors. If we want to ignore errors here, we can either run clang-tidy and FileCheck directly from the test or add a parameter to the script to modify the -implicit-check-not parameter of the FileCheck. |
test/clang-tidy/readability-braces-around-statements-assert-failure.cpp | ||
---|---|---|
16 ↗ | (On Diff #47795) |
I reduce the test case manually. Now I use FileCheck with -implicit-check-not parameter to ignore all compilation errors. |
test/clang-tidy/readability-braces-around-statements-assert-failure.cpp | ||
---|---|---|
8 ↗ | (On Diff #47795) | Tests shouldn't include any library headers. This is problematic in many different ways:
This is why we usually model APIs needed for the test in the tests (e.g. see test/clang-tidy/misc-inaccurate-erase.cpp). In this specific case the check doesn't need an actual std::vector<>, it just needs to simulate a specific compile error that would lead to a specific incompleteness in the AST. So, please, reduce the test case (the largest reduction would be the removal of #include <vector>) ;) |
16 ↗ | (On Diff #47795) |
That's why I was asking about creduce. It can do a much better job with a much less manual effort ;) |
test/clang-tidy/readability-braces-around-statements-assert-failure.cpp | ||
---|---|---|
1 ↗ | (On Diff #47959) | This is the simplest way to ignore all the compilation errors while keeping assert failure in the test. The check-clang-tools test script handles all stuff for us. |
7 ↗ | (On Diff #47959) | Reduce to the minimal test case now. C-Reduce is a useful tool :D. |