brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.2 KiB · 44d43eb Raw
84 lines · cpp
1// RUN: clang-tidy -dump-config %S/Inputs/config-files/- -- | FileCheck %s -check-prefix=CHECK-BASE2// CHECK-BASE: Checks: {{.*}}from-parent3// CHECK-BASE: HeaderFilterRegex: parent4// CHECK-BASE: ExcludeHeaderFilterRegex: exc-parent5// RUN: clang-tidy -dump-config %S/Inputs/config-files/1/- -- | FileCheck %s -check-prefix=CHECK-CHILD16// CHECK-CHILD1: Checks: {{.*}}from-child17// CHECK-CHILD1: HeaderFilterRegex: child18// CHECK-CHILD1: ExcludeHeaderFilterRegex: exc-child19// RUN: clang-tidy -dump-config %S/Inputs/config-files/2/- -- | FileCheck %s -check-prefix=CHECK-CHILD210// CHECK-CHILD2: Checks: {{.*}}from-parent11// CHECK-CHILD2: HeaderFilterRegex: parent12// CHECK-CHILD2: ExcludeHeaderFilterRegex: exc-parent13// RUN: clang-tidy -dump-config %S/Inputs/config-files/3/- -- | FileCheck %s -check-prefix=CHECK-CHILD314// CHECK-CHILD3: Checks: {{.*}}from-parent,from-child315// CHECK-CHILD3: HeaderFilterRegex: child316// CHECK-CHILD3: ExcludeHeaderFilterRegex: exc-child317// 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-LINE18// CHECK-COMMAND-LINE: Checks: {{.*}}from-parent,from-command-line19// CHECK-COMMAND-LINE: HeaderFilterRegex: from command line20// CHECK-COMMAND-LINE: ExcludeHeaderFilterRegex: from_command_line21 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> CheckOptions24// RUN: clang-tidy -dump-config %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD425// Running with the new <key>: <value> syntax26// RUN: clang-tidy -dump-config %S/Inputs/config-files/4/key-dict/- -- | FileCheck %s -check-prefix=CHECK-CHILD427 28// CHECK-CHILD4: Checks: {{.*}}modernize-loop-convert,modernize-use-using,llvm-qualified-auto29// 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: reasonable32// 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-EXPLAIN35// 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-CHILD544// Also test with the {Key: Value} Syntax specified on command line45// 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-CHILD550 51// CHECK-CHILD5: Checks: {{.*}}modernize-loop-convert,modernize-use-using,llvm-qualified-auto,-llvm-qualified-auto52// CHECK-CHILD5-DAG: modernize-loop-convert.MaxCopySize: '21'53// CHECK-CHILD5-DAG: modernize-loop-convert.MinConfidence: reasonable54// 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-CHILD660// CHECK-CHILD6: Checks: {{.*-llvm-qualified-auto'? *$}}61// CHECK-CHILD6-NOT: modernize-use-using.IgnoreMacros62 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-CHILD767// CHECK-CHILD7: readability-function-size.LineThreshold: none68 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 --check72 73// Dumped config does not overflow for unsigned options74// RUN: clang-tidy --dump-config %S/Inputs/config-files/5/- -- | FileCheck %s -check-prefix=CHECK-OVERFLOW75// 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-HEADERS78// 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-HEADERS82// EMPTY-CHECK-EXCLUDE-HEADERS: HeaderFilterRegex: ''83// EMPTY-CHECK-EXCLUDE-HEADERS: ExcludeHeaderFilterRegex: ''84