2 // RUN: mkdir -p %t.dir/level1/level2
5 // RUN: echo "*" > .clang-format-ignore
6 // RUN: echo "level*/*.c*" >> .clang-format-ignore
7 // RUN: echo "*/*2/foo.*" >> .clang-format-ignore
9 // RUN: clang-format -verbose .clang-format-ignore foo.cc 2>&1 \
10 // RUN: | FileCheck %s -allow-empty
13 // RUN: touch bar.cc baz.c
14 // RUN: clang-format -verbose bar.cc baz.c 2>&1 | FileCheck %s -allow-empty
17 // RUN: touch foo.c foo.js
18 // RUN: clang-format -verbose foo.c foo.js 2>&1 | FileCheck %s -allow-empty
20 // CHECK-NOT: Formatting
22 // RUN: touch .clang-format-ignore
23 // RUN: clang-format -verbose foo.c foo.js 2>&1 \
24 // RUN: | FileCheck %s -check-prefix=CHECK2 -match-full-lines
25 // CHECK2: Formatting [1/2] foo.c
26 // CHECK2-NEXT: Formatting [2/2] foo.js
28 // RUN: echo "*.js" > .clang-format-ignore
29 // RUN: clang-format -verbose foo.c foo.js 2>&1 \
30 // RUN: | FileCheck %s -check-prefix=CHECK3 -match-full-lines
31 // CHECK3: Formatting [1/2] foo.c
35 // RUN: clang-format -verbose *.cc level1/*.c* level1/level2/foo.* 2>&1 \
36 // RUN: | FileCheck %s -check-prefix=CHECK4 -match-full-lines
37 // CHECK4: {{Formatting \[1/5] .*foo\.c}}
40 // RUN: rm .clang-format-ignore
41 // RUN: clang-format -verbose *.cc level1/*.c* level1/level2/foo.* 2>&1 \
42 // RUN: | FileCheck %s -check-prefix=CHECK5 -match-full-lines
43 // 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}}
49 // RUN: echo "foo.*" > .clang-format-ignore
50 // RUN: echo "int i ;" > foo.c
51 // RUN: clang-format -assume-filename=foo.c < foo.c \
52 // RUN: | FileCheck %s -check-prefix=CHECK6 -allow-empty
55 // RUN: clang-format -assume-filename=bar.c < foo.c \
56 // RUN: | FileCheck %s -check-prefix=CHECK7 -match-full-lines