[PATCH] D118104: Make run-clang-tidy.py print the configured checks correctly
Salman Javed via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 4 03:48:19 PST 2022
salman-javed-nz added a comment.
In D118104#3292862 <https://reviews.llvm.org/D118104#3292862>, @JesApp wrote:
> Well, since this was more of source of confusion than actual incorrect behaviour, I don't think there should be a test for it.
>
> In general though, I think the script is complex enough to warrant some testing. That being said: I don't think they should be part of this patch. Also, I'm doing this on company time and I don't think my boss would be to happy if I wrote a testsuite from scratch when I just wanted to fix one bug. :D
I wasn't asking about creating a new test suite from scratch. I guess I wasn't clear.
The idea I had was a file in `clang-tools-extra\test\clang-tidy\infrastructure` with something like this:
// RUN: %run_clang_tidy -checks="-*,google-explicit-constructor,modernize-use-auto" %s | FileCheck -check-prefix=CHECK-ENABLED-CHECKS-1 %s
// CHECK-ENABLED-CHECKS-1: Enabled checks:
// CHECK-ENABLED-CHECKS-1-NEXT: google-explicit-constructor
// CHECK-ENABLED-CHECKS-1-NEXT: modernize-use-auto
// RUN: %run_clang_tidy -checks="-*,google-explicit-constructor,modernize-use-auto" -config "Checks: -modernize-use-auto" %s | FileCheck -check-prefix=CHECK-ENABLED-CHECKS-2 %s
// CHECK-ENABLED-CHECKS-2: Enabled checks:
// CHECK-ENABLED-CHECKS-2-NEXT: google-explicit-constructor
// CHECK-ENABLED-CHECKS-2-NOT: modernize-use-auto
Note: I haven't tested this. If it doesn't work, then it's probably a minor tweak away from working.
This would confirm that the "Enabled checks:" message reflects the combined results of `-checks` and `-config` arguments.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118104/new/
https://reviews.llvm.org/D118104
More information about the cfe-commits
mailing list