This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] extend tests of run-clang-tidy
ClosedPublic

Authored by AlexanderLanin on Feb 9 2020, 2:26 PM.

Details

Summary
  • new test: parsing and using compile_commands
  • new test: export fixes to yaml file
  • old test extended with CHECK-MESSAGES in order to ensure that they "fail as intended"

Diff Detail

Event Timeline

AlexanderLanin created this revision.Feb 9 2020, 2:26 PM

I tested this in WSL1 with ninja check-clang-tools.
Is there anything else I can do (besides setting up a second OS)?

This looks reasonable to me, though I haven't ever approved a review, so I would leave that to others set as reviewers.

*ping*

Just new tests, easy to review :-)

In case this one is ok, please feel free to commit it as I cannot :-)
Alexander Lanin <alex@lanin.de>

Generally looks good to me, but I had a question about test coverage.

clang-tools-extra/test/clang-tidy/infrastructure/run-clang-tidy_config-file.cpp
1

Is there a reason to remove this test coverage? I believe this is testing that we can access the help without crashing.

AlexanderLanin planned changes to this revision.Jul 29 2020, 2:29 PM

The reason was that I thought that line doesn't do anything.
Of course "not crashing" is a valid expectation. If nothing else, then "not crashing" should indeed be tested.
I'll try to improve this ancient diff.

Readd removed 'print help without crashing' test

This revision is now accepted and ready to land.Oct 19 2020, 7:07 AM
AlexanderLanin marked an inline comment as done.Oct 19 2020, 7:09 AM

Could someone commit this as I cannot? Thanks a lot!
Alexander Lanin <alex@lanin.de>

Thanks for review @aaron.ballman!

aaron.ballman closed this revision.Oct 19 2020, 7:29 AM

Could someone commit this as I cannot? Thanks a lot!
Alexander Lanin <alex@lanin.de>

Thanks for review @aaron.ballman!

Happy to do so! I've commit on your behalf in 627c01bee0deb353b3e3e90c1b8d0b6d73464466

Could someone commit this as I cannot? Thanks a lot!
Alexander Lanin <alex@lanin.de>

Thanks for review @aaron.ballman!

Happy to do so! I've commit on your behalf in 627c01bee0deb353b3e3e90c1b8d0b6d73464466

Unfortunately, I had to revert in b91a236ee1c3e9fa068df058164385732cb46bba because of failing build bots. Would you mind taking a look?

I cannot reproduce the problem and there is just not enough info to go on.
Is there any way to get anything in addition? e.g. run the same test with -vv or add some additional print commands?
Maybe it's some access rights problem, or different version of some non obvious dependency or something like that.
Maybe it's as trivial as having to use double quotes for -checks='-*,bugprone-sizeof-container,modernize-use-auto'.
It seems run-clang-tidy exits with code 2, but there is no way it would do that. So I'm totally lost.
http://lab.llvm.org:8011/#/builders/109/builds/690/steps/6/logs/FAIL__Clang_Tools__run-clang-tidy_export-diagnosti

I cannot reproduce the problem and there is just not enough info to go on.

Ugh, I hate when that happens. :-(

Is there any way to get anything in addition? e.g. run the same test with -vv or add some additional print commands?

We could speculatively commit with additional commands if that'd help you with debugging. We'd be purposefully breaking the build for a few minutes which is never ideal, but if we coordinate properly, it shouldn't be too disruptive.

Maybe it's some access rights problem, or different version of some non obvious dependency or something like that.
Maybe it's as trivial as having to use double quotes for -checks='-*,bugprone-sizeof-container,modernize-use-auto'.
It seems run-clang-tidy exits with code 2, but there is no way it would do that. So I'm totally lost.
http://lab.llvm.org:8011/#/builders/109/builds/690/steps/6/logs/FAIL__Clang_Tools__run-clang-tidy_export-diagnosti

Could it be that some other part of the test is what's generating that result code (like, could it be the result from python of running lit)?

clang-tools-extra/test/clang-tidy/infrastructure/run-clang-tidy_export-diagnostics.cpp
9

The %/S here looks a bit suspicious to me, was that supposed to be %S with the / somewhere else?