Joel E. Denny | e1af89a | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 1 | ; RUN: echo ciao > %t.good |
| 2 | ; RUN: echo world >> %t.good |
| 3 | |
| 4 | ; RUN: echo hello > %t.err |
| 5 | ; RUN: echo world >> %t.err |
| 6 | |
| 7 | ; RUN: echo 'CHECK: ciao' > %t.check |
| 8 | ; RUN: echo 'CHECK-NEXT: world' >> %t.check |
| 9 | |
| 10 | ;-------------------------------------------------- |
| 11 | ; unknown value |
| 12 | ;-------------------------------------------------- |
| 13 | |
| 14 | ; RUN: not FileCheck -input-file %t.good %t.check -check-prefix=CHECK \ |
| 15 | ; RUN: -match-full-lines -dump-input=foobar 2>&1 \ |
| 16 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=BADVAL |
| 17 | |
| 18 | ; No positional arg. |
| 19 | ; RUN: not FileCheck -dump-input=foobar 2>&1 \ |
| 20 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=BADVAL |
| 21 | |
Joel E. Denny | c0102bb | 2018-12-18 01:17:28 +0000 | [diff] [blame] | 22 | BADVAL: FileCheck{{.*}}: for the -dump-input option: Cannot find option named 'foobar'! |
Joel E. Denny | e1af89a | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 23 | |
| 24 | ;-------------------------------------------------- |
| 25 | ; help |
| 26 | ;-------------------------------------------------- |
| 27 | |
| 28 | ; Appended to normal command line. |
| 29 | ; RUN: FileCheck -input-file %t.err -color %t.check -dump-input=help \ |
| 30 | ; RUN: | FileCheck %s -check-prefix=HELP |
| 31 | |
| 32 | ; No positional arg. |
| 33 | ; RUN: FileCheck -dump-input=help | FileCheck %s -check-prefix=HELP |
| 34 | |
| 35 | HELP-NOT: {{.}} |
| 36 | HELP: The following description was requested by -dump-input=help |
| 37 | HELP: try{{.*}}-color |
| 38 | HELP-NOT: {{.}} |
| 39 | |
| 40 | ;-------------------------------------------------- |
| 41 | ; never |
| 42 | ;-------------------------------------------------- |
| 43 | |
| 44 | ; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \ |
| 45 | ; RUN: -match-full-lines -dump-input=never 2>&1 \ |
| 46 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP -allow-empty |
| 47 | |
| 48 | ; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \ |
| 49 | ; RUN: -match-full-lines -dump-input=never 2>&1 \ |
| 50 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP |
| 51 | |
| 52 | ;-------------------------------------------------- |
| 53 | ; default: never |
| 54 | ;-------------------------------------------------- |
| 55 | |
| 56 | ; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \ |
| 57 | ; RUN: -match-full-lines 2>&1 \ |
| 58 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP -allow-empty |
| 59 | |
| 60 | ; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \ |
| 61 | ; RUN: -match-full-lines 2>&1 \ |
| 62 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP |
| 63 | |
| 64 | ;-------------------------------------------------- |
| 65 | ; fail |
| 66 | ;-------------------------------------------------- |
| 67 | |
| 68 | ; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \ |
| 69 | ; RUN: -match-full-lines -dump-input=fail 2>&1 \ |
| 70 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP -allow-empty |
| 71 | |
| 72 | ; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \ |
| 73 | ; RUN: -match-full-lines -dump-input=fail 2>&1 \ |
| 74 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-ERR |
| 75 | |
| 76 | ;-------------------------------------------------- |
| 77 | ; -dump-input-on-failure |
| 78 | ;-------------------------------------------------- |
| 79 | |
| 80 | ; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \ |
| 81 | ; RUN: -match-full-lines -dump-input-on-failure 2>&1 \ |
| 82 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP -allow-empty |
| 83 | |
| 84 | ; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \ |
| 85 | ; RUN: -match-full-lines -dump-input-on-failure 2>&1 \ |
| 86 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-ERR |
| 87 | |
| 88 | ; RUN: env FILECHECK_DUMP_INPUT_ON_FAILURE=1 \ |
| 89 | ; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \ |
| 90 | ; RUN: -match-full-lines 2>&1 \ |
| 91 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP -allow-empty |
| 92 | |
| 93 | ; RUN: env FILECHECK_DUMP_INPUT_ON_FAILURE=1 \ |
| 94 | ; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \ |
| 95 | ; RUN: -match-full-lines 2>&1 \ |
| 96 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-ERR |
| 97 | |
| 98 | ;-------------------------------------------------- |
| 99 | ; always |
| 100 | ;-------------------------------------------------- |
| 101 | |
| 102 | ; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \ |
| 103 | ; RUN: -match-full-lines -dump-input=always -v 2>&1 \ |
| 104 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-GOOD |
| 105 | |
| 106 | ; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \ |
| 107 | ; RUN: -match-full-lines -dump-input=always 2>&1 \ |
| 108 | ; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-ERR |
| 109 | |
| 110 | ; END. |
| 111 | |
| 112 | ; CHECK-GOOD: Full input was: |
| 113 | ; CHECK-GOOD-NEXT: <<<<<< |
| 114 | ; CHECK-GOOD-NEXT: 1: ciao |
Joel E. Denny | cf38e31 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 115 | ; CHECK-GOOD-NEXT: check:1 ^~~~ |
Joel E. Denny | e1af89a | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 116 | ; CHECK-GOOD-NEXT: 2: world |
Joel E. Denny | cf38e31 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 117 | ; CHECK-GOOD-NEXT: next:2 ^~~~~ |
Joel E. Denny | e1af89a | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 118 | ; CHECK-GOOD-NEXT: >>>>>> |
| 119 | |
| 120 | ; CHECK-ERR: Full input was: |
| 121 | ; CHECK-ERR-NEXT: <<<<<< |
| 122 | ; CHECK-ERR-NEXT: 1: hello |
| 123 | ; CHECK-ERR-NEXT: check:1 X~~~~ |
| 124 | ; CHECK-ERR-NEXT: 2: world |
| 125 | ; CHECK-ERR-NEXT: check:1 ~~~~~ error: no match found |
| 126 | ; CHECK-ERR-NEXT: >>>>>> |
| 127 | |
| 128 | ; CHECK-NODUMP-NOT: <<<<<< |