-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Evaluate argument of (DYNAMIC_)SECTION, TEST_CASE in static-analysis mode #2817
Evaluate argument of (DYNAMIC_)SECTION, TEST_CASE in static-analysis mode #2817
Conversation
Not sure if/where should I add tests for this. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #2817 +/- ##
==========================================
- Coverage 91.20% 91.16% -0.04%
==========================================
Files 197 197
Lines 8374 8381 +7
==========================================
+ Hits 7637 7640 +3
- Misses 737 741 +4 |
I am reasonably sure that this breaks This is a valid |
Huh, interesting. I had no idea it can be used like that 😄 Any tips where the tests for this should be? |
e63e8de
to
e3c7866
Compare
Some limitations:
Also, I might add some clang-tidy-specific tests later to test that |
# Extras and examples with clang-tidy-10 | ||
- version: "10" | ||
tidy_options: '' | ||
build_description: Extras + Examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build_description: Extras + Examples | |
build_description: clang-tidy |
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"clang-tidy" is already included in the job description. I've replaced this by "all", but it's not really completely all. I guess it's hard to put variant-specific description when there is just one variant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, then "extras + examples" is fine.
That's not great. Maybe we could merge the clang-tidy check into an already existing build? This would create a build with outsized build time, but we can't build all the builds in parallel either way, so as long as it gets scheduled reasonably early it shouldn't have much impact.
Yes, they are indeed compiled multiple times in the full test build. Some tests require building against custom configuration of the implementation binary, so they have to rebuild it. You can find them quickly by looking for targets that link against
Definitely. The checks in clang-tidy can be a mess, with overlapping checks with different implementation, this came up in the original discussion for the static-analysis mode. Having a reasonable set that we can point to as being supported would be nice.
It almost definitely cannot understand it. The reasoning there is only slightly simpler than figuring out |
da16234
to
6e8ab59
Compare
In the end, I have rewritten the CI job to use The Werror is enabled for some concrete checks. Unfortunately, we cannot enable We also have to disable |
b984a7b
to
09c1359
Compare
bd1bc51
to
2f514ae
Compare
So, I have split each check to its separate commit as you wanted. It's up to you now to select which ones do you want to keep and which ones you want to suppress instead. |
2f514ae
to
b5ddc42
Compare
@@ -117,7 +117,7 @@ namespace Catch { | |||
auto kv = splitKVPair( parts[i] ); | |||
auto key = kv.key, value = kv.value; | |||
|
|||
if ( key.empty() || value.empty() ) { | |||
if ( key.empty() || value.empty() ) { // NOLINT(bugprone-branch-clone) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's supposed to be duplicated here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else
branch waaay down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh, that's dumb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very 😄
b5ddc42
to
4bcbf60
Compare
fcb1495
to
ed35b1c
Compare
ed35b1c
to
fcc7c07
Compare
* bugprone-branch-clone * bugprone-copy-constructor-init * bugprone-empty-catch * bugprone-sizeof-expression * bugprone-switch-missing-default-case * bugprone-unused-local-non-trivial-variable * clang-analyzer-core.uninitialized.Assign * clang-analyzer-cplusplus.Move * clang-analyzer-optin.cplusplus.VirtualCall * modernize-loop-convert * modernize-raw-string-literal * modernize-use-equals-default * modernize-use-override * modernize-use-using * performance-avoid-endl * performance-inefficient-string-concatenation * performance-inefficient-vector-operation * performance-noexcept-move-constructor * performance-unnecessary-value-param (and improve generator example) * readability-duplicate-include * readability-inconsistent-declaration-parameter-name * readability-non-const-parameter * readability-redundant-casting * readability-redundant-member-init * readability-redundant-smartptr-get * readability-static-accessed-through-instance * unused variable in amalgamted tests
fcc7c07
to
c700cae
Compare
Description
As the title says, it's fairly straightforward.
And also add configuration for
clang-tidy
, run it in CI, and fix/suppress the resulting warnings.GitHub Issues
Closes #2816