|
7 | 7 | // RUN: echo "level*/*.c*" >> .clang-format-ignore
|
8 | 8 | // RUN: echo "*/*2/foo.*" >> .clang-format-ignore
|
9 | 9 | // RUN: touch foo.cc
|
10 |
| -// RUN: clang-format -verbose .clang-format-ignore foo.cc 2> %t.stderr |
11 |
| -// RUN: not grep Formatting %t.stderr |
| 10 | +// RUN: clang-format -verbose .clang-format-ignore foo.cc 2>&1 \ |
| 11 | +// RUN: | FileCheck %s -allow-empty |
12 | 12 |
|
13 | 13 | // RUN: cd level1
|
14 | 14 | // RUN: touch bar.cc baz.c
|
15 |
| -// RUN: clang-format -verbose bar.cc baz.c 2> %t.stderr |
16 |
| -// RUN: not grep Formatting %t.stderr |
| 15 | +// RUN: clang-format -verbose bar.cc baz.c 2>&1 | FileCheck %s -allow-empty |
17 | 16 |
|
18 | 17 | // RUN: cd level2
|
19 | 18 | // RUN: touch foo.c foo.js
|
20 |
| -// RUN: clang-format -verbose foo.c foo.js 2> %t.stderr |
21 |
| -// RUN: not grep Formatting %t.stderr |
| 19 | +// RUN: clang-format -verbose foo.c foo.js 2>&1 | FileCheck %s -allow-empty |
| 20 | + |
| 21 | +// CHECK-NOT: Formatting |
22 | 22 |
|
23 | 23 | // RUN: touch .clang-format-ignore
|
24 |
| -// RUN: clang-format -verbose foo.c foo.js 2> %t.stderr |
25 |
| -// RUN: grep -Fx "Formatting [1/2] foo.c" %t.stderr |
26 |
| -// RUN: grep -Fx "Formatting [2/2] foo.js" %t.stderr |
| 24 | +// RUN: clang-format -verbose foo.c foo.js 2>&1 \ |
| 25 | +// RUN: | FileCheck %s -check-prefix=CHECK2 -match-full-lines |
| 26 | +// CHECK2: Formatting [1/2] foo.c |
| 27 | +// CHECK2-NEXT: Formatting [2/2] foo.js |
27 | 28 |
|
28 | 29 | // RUN: echo "*.js" > .clang-format-ignore
|
29 |
| -// RUN: clang-format -verbose foo.c foo.js 2> %t.stderr |
30 |
| -// RUN: grep -Fx "Formatting [1/2] foo.c" %t.stderr |
31 |
| -// RUN: not grep -F foo.js %t.stderr |
| 30 | +// RUN: clang-format -verbose foo.c foo.js 2>&1 \ |
| 31 | +// RUN: | FileCheck %s -check-prefix=CHECK3 -match-full-lines |
| 32 | +// CHECK3: Formatting [1/2] foo.c |
| 33 | +// CHECK3-NOT: foo.js |
32 | 34 |
|
33 | 35 | // RUN: cd ../..
|
34 |
| -// RUN: clang-format -verbose *.cc level1/*.c* level1/level2/foo.* 2> %t.stderr |
35 |
| -// RUN: grep -x "Formatting \[1/5] .*foo\.c" %t.stderr |
36 |
| -// RUN: not grep -F foo.js %t.stderr |
| 36 | +// RUN: clang-format -verbose *.cc level1/*.c* level1/level2/foo.* 2>&1 \ |
| 37 | +// RUN: | FileCheck %s -check-prefix=CHECK4 -match-full-lines |
| 38 | +// CHECK4: {{Formatting \[1/5] .*foo\.c}} |
| 39 | +// CHECK4-NOT: foo.js |
37 | 40 |
|
38 | 41 | // RUN: rm .clang-format-ignore
|
39 |
| -// RUN: clang-format -verbose *.cc level1/*.c* level1/level2/foo.* 2> %t.stderr |
40 |
| -// RUN: grep -x "Formatting \[1/5] .*foo\.cc" %t.stderr |
41 |
| -// RUN: grep -x "Formatting \[2/5] .*bar\.cc" %t.stderr |
42 |
| -// RUN: grep -x "Formatting \[3/5] .*baz\.c" %t.stderr |
43 |
| -// RUN: grep -x "Formatting \[4/5] .*foo\.c" %t.stderr |
44 |
| -// RUN: not grep -F foo.js %t.stderr |
| 42 | +// RUN: clang-format -verbose *.cc level1/*.c* level1/level2/foo.* 2>&1 \ |
| 43 | +// RUN: | FileCheck %s -check-prefix=CHECK5 -match-full-lines |
| 44 | +// CHECK5: {{Formatting \[1/5] .*foo\.cc}} |
| 45 | +// CHECK5-NEXT: {{Formatting \[2/5] .*bar\.cc}} |
| 46 | +// CHECK5-NEXT: {{Formatting \[3/5] .*baz\.c}} |
| 47 | +// CHECK5-NEXT: {{Formatting \[4/5] .*foo\.c}} |
| 48 | +// CHECK5-NOT: foo.js |
45 | 49 |
|
46 | 50 | // RUN: cd ..
|
47 | 51 | // RUN: rm -r %t.dir
|
0 commit comments