brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 67d68ae Raw
61 lines · cpp
1// RUN: rm -rf %t.dir2// RUN: mkdir -p %t.dir/level1/level23 4// RUN: cd %t.dir5// RUN: echo "*" > .clang-format-ignore6// RUN: echo "level*/*.c*" >> .clang-format-ignore7// RUN: echo "*/*2/foo.*" >> .clang-format-ignore8// RUN: touch foo.cc9// RUN: clang-format -verbose .clang-format-ignore foo.cc 2>&1 \10// RUN:   | FileCheck %s -allow-empty11 12// RUN: cd level113// RUN: touch bar.cc baz.c14// RUN: clang-format -verbose bar.cc baz.c 2>&1 | FileCheck %s -allow-empty15 16// RUN: cd level217// RUN: touch foo.c foo.js18// RUN: clang-format -verbose foo.c foo.js 2>&1 | FileCheck %s -allow-empty19 20// CHECK-NOT: Formatting21 22// RUN: touch .clang-format-ignore23// RUN: clang-format -verbose foo.c foo.js 2>&1 \24// RUN:   | FileCheck %s -check-prefix=CHECK2 -match-full-lines25// CHECK2: Formatting [1/2] foo.c26// CHECK2-NEXT: Formatting [2/2] foo.js27 28// RUN: echo "*.js" > .clang-format-ignore29// RUN: clang-format -verbose foo.c foo.js 2>&1 \30// RUN:   | FileCheck %s -check-prefix=CHECK3 -match-full-lines31// CHECK3: Formatting [1/2] foo.c32// CHECK3-NOT: foo.js33 34// RUN: cd ../..35// RUN: clang-format -verbose *.cc level1/*.c* level1/level2/foo.* 2>&1 \36// RUN:   | FileCheck %s -check-prefix=CHECK4 -match-full-lines37// CHECK4: {{Formatting \[1/5] .*foo\.c}}38// CHECK4-NOT: foo.js39 40// RUN: rm .clang-format-ignore41// RUN: clang-format -verbose *.cc level1/*.c* level1/level2/foo.* 2>&1 \42// RUN:   | FileCheck %s -check-prefix=CHECK5 -match-full-lines43// CHECK5: {{Formatting \[1/5] .*foo\.cc}}44// CHECK5-NEXT: {{Formatting \[2/5] .*bar\.cc}}45// CHECK5-NEXT: {{Formatting \[3/5] .*baz\.c}}46// CHECK5-NEXT: {{Formatting \[4/5] .*foo\.c}}47// CHECK5-NOT: foo.js48 49// RUN: echo "foo.*" > .clang-format-ignore50// RUN: echo "int i ;" > foo.c51// RUN: clang-format -assume-filename=foo.c < foo.c \52// RUN:   | FileCheck %s -check-prefix=CHECK6 -allow-empty53// CHECK6-NOT: int54 55// RUN: clang-format -assume-filename=bar.c < foo.c \56// RUN:   | FileCheck %s -check-prefix=CHECK7 -match-full-lines57// CHECK7: int i;58 59// RUN: cd ..60// RUN: rm -r %t.dir61