| 1 |
// RUN: clang-tidy -dump-config %S/Inputs/config-files/- -- | FileCheck %s -check-prefix=CHECK-BASE |
| 2 |
// CHECK-BASE: Checks: {{.*}}from-parent |
| 3 |
// CHECK-BASE: HeaderFilterRegex: parent |
| 4 |
// CHECK-BASE: ExcludeHeaderFilterRegex: exc-parent |
| 5 |
// RUN: clang-tidy -dump-config %S/Inputs/config-files/1/- -- | FileCheck %s -check-prefix=CHECK-CHILD1 |
| 6 |
// CHECK-CHILD1: Checks: {{.*}}from-child1 |
| 7 |
// CHECK-CHILD1: HeaderFilterRegex: child1 |
| 8 |
// CHECK-CHILD1: ExcludeHeaderFilterRegex: exc-child1 |
| 9 |
// RUN: clang-tidy -dump-config %S/Inputs/config-files/2/- -- | FileCheck %s -check-prefix=CHECK-CHILD2 |
| 10 |
// CHECK-CHILD2: Checks: {{.*}}from-parent |
| 11 |
// CHECK-CHILD2: HeaderFilterRegex: parent |
| 12 |
// CHECK-CHILD2: ExcludeHeaderFilterRegex: exc-parent |
| 13 |
// RUN: clang-tidy -dump-config %S/Inputs/config-files/3/- -- | FileCheck %s -check-prefix=CHECK-CHILD3 |
| 14 |
// CHECK-CHILD3: Checks: {{.*}}from-parent,from-child3 |
| 15 |
// CHECK-CHILD3: HeaderFilterRegex: child3 |
| 16 |
// CHECK-CHILD3: ExcludeHeaderFilterRegex: exc-child3 |
| 17 |
// RUN: clang-tidy -dump-config -checks='from-command-line' -header-filter='from command line' -exclude-header-filter='from_command_line' %S/Inputs/config-files/- -- | FileCheck %s -check-prefix=CHECK-COMMAND-LINE |
| 18 |
// CHECK-COMMAND-LINE: Checks: {{.*}}from-parent,from-command-line |
| 19 |
// CHECK-COMMAND-LINE: HeaderFilterRegex: from command line |
| 20 |
// CHECK-COMMAND-LINE: ExcludeHeaderFilterRegex: from_command_line |
| 21 |
|
| 22 |
// For this test we have to use names of the real checks because otherwise values are ignored. |
| 23 |
// Running with the old key: <Key>, value: <value> CheckOptions |
| 24 |
// RUN: clang-tidy -dump-config %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD4 |
| 25 |
// Running with the new <key>: <value> syntax |
| 26 |
// RUN: clang-tidy -dump-config %S/Inputs/config-files/4/key-dict/- -- | FileCheck %s -check-prefix=CHECK-CHILD4 |
| 27 |
|
| 28 |
// CHECK-CHILD4: Checks: {{.*}}modernize-loop-convert,modernize-use-using,llvm-qualified-auto |
| 29 |
// CHECK-CHILD4-DAG: llvm-qualified-auto.AddConstToQualified: 'true' |
| 30 |
// CHECK-CHILD4-DAG: modernize-loop-convert.MaxCopySize: '20' |
| 31 |
// CHECK-CHILD4-DAG: modernize-loop-convert.MinConfidence: reasonable |
| 32 |
// CHECK-CHILD4-DAG: modernize-use-using.IgnoreMacros: 'false' |
| 33 |
|
| 34 |
// RUN: clang-tidy --explain-config %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-EXPLAIN |
| 35 |
// CHECK-EXPLAIN: 'llvm-qualified-auto' is enabled in the {{.*}}{{[/\\]}}Inputs{{[/\\]}}config-files{{[/\\]}}4{{[/\\]}}44{{[/\\]}}.clang-tidy. |
| 36 |
// CHECK-EXPLAIN: 'modernize-loop-convert' is enabled in the {{.*}}{{[/\\]}}Inputs{{[/\\]}}config-files{{[/\\]}}4{{[/\\]}}.clang-tidy. |
| 37 |
// CHECK-EXPLAIN: 'modernize-use-using' is enabled in the {{.*}}{{[/\\]}}Inputs{{[/\\]}}config-files{{[/\\]}}4{{[/\\]}}.clang-tidy. |
| 38 |
|
| 39 |
// RUN: clang-tidy -dump-config \ |
| 40 |
// RUN: --config='{InheritParentConfig: true, \ |
| 41 |
// RUN: Checks: -llvm-qualified-auto, \ |
| 42 |
// RUN: CheckOptions: [{key: modernize-loop-convert.MaxCopySize, value: 21}]}' \ |
| 43 |
// RUN: %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD5 |
| 44 |
// Also test with the {Key: Value} Syntax specified on command line |
| 45 |
// RUN: clang-tidy -dump-config \ |
| 46 |
// RUN: --config='{InheritParentConfig: true, \ |
| 47 |
// RUN: Checks: -llvm-qualified-auto, \ |
| 48 |
// RUN: CheckOptions: {modernize-loop-convert.MaxCopySize: 21}}' \ |
| 49 |
// RUN: %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD5 |
| 50 |
|
| 51 |
// CHECK-CHILD5: Checks: {{.*}}modernize-loop-convert,modernize-use-using,llvm-qualified-auto,-llvm-qualified-auto |
| 52 |
// CHECK-CHILD5-DAG: modernize-loop-convert.MaxCopySize: '21' |
| 53 |
// CHECK-CHILD5-DAG: modernize-loop-convert.MinConfidence: reasonable |
| 54 |
// CHECK-CHILD5-DAG: modernize-use-using.IgnoreMacros: 'false' |
| 55 |
|
| 56 |
// RUN: clang-tidy -dump-config \ |
| 57 |
// RUN: --config='{InheritParentConfig: false, \ |
| 58 |
// RUN: Checks: -llvm-qualified-auto}' \ |
| 59 |
// RUN: %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD6 |
| 60 |
// CHECK-CHILD6: Checks: {{.*-llvm-qualified-auto'? *$}} |
| 61 |
// CHECK-CHILD6-NOT: modernize-use-using.IgnoreMacros |
| 62 |
|
| 63 |
// RUN: clang-tidy -dump-config \ |
| 64 |
// RUN: --config='{CheckOptions: {readability-function-size.LineThreshold: ""}, \ |
| 65 |
// RUN: Checks: readability-function-size}' \ |
| 66 |
// RUN: %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD7 |
| 67 |
// CHECK-CHILD7: readability-function-size.LineThreshold: none |
| 68 |
|
| 69 |
|
| 70 |
// Validate that check options are printed in alphabetical order: |
| 71 |
// RUN: clang-tidy --checks="-*,readability-identifier-naming" --dump-config %S/Inputs/config-files/- -- | grep "readability-identifier-naming\." | sort --check |
| 72 |
|
| 73 |
// Dumped config does not overflow for unsigned options |
| 74 |
// RUN: clang-tidy --dump-config %S/Inputs/config-files/5/- -- | FileCheck %s -check-prefix=CHECK-OVERFLOW |
| 75 |
// CHECK-OVERFLOW: misc-throw-by-value-catch-by-reference.MaxSize: '1152921504606846976' |
| 76 |
|
| 77 |
// RUN: clang-tidy -dump-config -checks='readability-function-size' -header-filter='foo/*' -exclude-header-filter='bar*' %S/Inputs/config-files/- -- | FileCheck %s -check-prefix=CHECK-EXCLUDE-HEADERS |
| 78 |
// CHECK-EXCLUDE-HEADERS: HeaderFilterRegex: 'foo/*' |
| 79 |
// CHECK-EXCLUDE-HEADERS: ExcludeHeaderFilterRegex: 'bar*' |
| 80 |
|
| 81 |
// RUN: clang-tidy -dump-config -checks='readability-function-size' -header-filter='' -exclude-header-filter='' %S/Inputs/config-files/- -- | FileCheck %s -check-prefix=EMPTY-CHECK-EXCLUDE-HEADERS |
| 82 |
// EMPTY-CHECK-EXCLUDE-HEADERS: HeaderFilterRegex: '' |
| 83 |
// EMPTY-CHECK-EXCLUDE-HEADERS: ExcludeHeaderFilterRegex: '' |