reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161
  162
  163
  164
  165
  166
  167
  168
  169
  170
  171
  172
  173
  174
  175
;--------------------------------------------------
; Create the check file, good input, and bad input.
;
; For both good and bad input, make sure the -v trace has at least one remark
; so we can check how trace suppression is affected by -dump-input.
;--------------------------------------------------

; RUN: echo hello > %t.good
; RUN: echo world >> %t.good

; RUN: echo hello > %t.err
; RUN: echo whirled >> %t.err

; RUN: echo 'CHECK: hello' > %t.check
; RUN: echo 'CHECK-NEXT: world' >> %t.check

;--------------------------------------------------
; Check -dump-input=<bad value>.
;--------------------------------------------------

; RUN: not FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN:               -match-full-lines -dump-input=foobar 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefix=BADVAL

; No positional arg.
; RUN: not FileCheck -dump-input=foobar 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefix=BADVAL

BADVAL: {{F|f}}ile{{C|c}}heck{{.*}}: for the --dump-input option: Cannot find option named 'foobar'!

;--------------------------------------------------
; Check -dump-input=help.
;--------------------------------------------------

; Appended to normal command line.
; RUN: FileCheck -input-file %t.err -color %t.check -dump-input=help \
; RUN: | FileCheck %s -check-prefix=HELP

; No positional arg.
; RUN: FileCheck -dump-input=help | FileCheck %s -check-prefix=HELP

HELP-NOT: {{.}}
HELP: The following description was requested by -dump-input=help
HELP: try{{.*}}-color
HELP-NOT: {{.}}

;--------------------------------------------------
; Check -dump-input=never.
;
; Include the case without -v, which isn't covered elsewhere.
;--------------------------------------------------

; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN:           -match-full-lines -dump-input=never 2>&1 \
; RUN: | FileCheck %s -match-full-lines -allow-empty \
; RUN:             -check-prefixes=NOTRACE,NODUMP

; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN:               -match-full-lines -dump-input=never 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,ERR,NODUMP

; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN:           -match-full-lines -dump-input=never -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=TRACE,NODUMP

; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN:               -match-full-lines -dump-input=never -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=TRACE,ERR,NODUMP

;--------------------------------------------------
; Check no -dump-input, which defaults to never.
;--------------------------------------------------

; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN:           -match-full-lines -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=TRACE,NODUMP

; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN:               -match-full-lines -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=TRACE,ERR,NODUMP

;--------------------------------------------------
; Check -dump-input=fail.
;
; Include the case without -v, which isn't covered elsewhere.
;--------------------------------------------------

; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN:           -match-full-lines -dump-input=fail 2>&1 \
; RUN: | FileCheck %s -match-full-lines -allow-empty \
; RUN:             -check-prefixes=NOTRACE,NODUMP

; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN:               -match-full-lines -dump-input=fail 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,ERR,DUMP-ERR

; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN:           -match-full-lines -dump-input=fail -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -allow-empty \
; RUN:             -check-prefixes=NOTRACE,NODUMP

; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN:               -match-full-lines -dump-input=fail -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines \
; RUN:                -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V

;--------------------------------------------------
; Check -dump-input-on-failure.
;--------------------------------------------------

; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN:           -match-full-lines -dump-input-on-failure -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -allow-empty \
; RUN:             -check-prefixes=NOTRACE,NODUMP

; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN:               -match-full-lines -dump-input-on-failure -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines \
; RUN:                -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V

; RUN: env FILECHECK_DUMP_INPUT_ON_FAILURE=1 \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN:           -match-full-lines -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -allow-empty \
; RUN:             -check-prefixes=NOTRACE,NODUMP

; RUN: env FILECHECK_DUMP_INPUT_ON_FAILURE=1 \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN:               -match-full-lines -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines \
; RUN:                -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V

;--------------------------------------------------
; Check -dump-input=always.
;--------------------------------------------------

; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN:           -match-full-lines -dump-input=always -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK

; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN:               -match-full-lines -dump-input=always -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines \
; RUN:                -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V

; END.

;--------------------------------------------------
; Check the output for all cases that actually process directives.
;--------------------------------------------------

; Trace is sometimes suppressed.
; TRACE:       {{.*}}remark:{{.*}}
; NOTRACE-NOT: remark:

; Error diagnostics are never suppressed.
; ERR: {{.*}}error:{{.*}}

; NODUMP-NOT: <<<<<<

; DUMP-OK:      Full input was:
; DUMP-OK-NEXT: <<<<<<
; DUMP-OK-NEXT:          1: hello
; DUMP-OK-NEXT: check:1     ^~~~~
; DUMP-OK-NEXT:          2: world
; DUMP-OK-NEXT: next:2      ^~~~~
; DUMP-OK-NEXT: >>>>>>

; DUMP-ERR:        Full input was:
; DUMP-ERR-NEXT:   <<<<<<
; DUMP-ERR-NEXT:            1: hello
; DUMP-ERR-V-NEXT: check:1     ^~~~~
; DUMP-ERR-NEXT:            2: whirled
; DUMP-ERR-NEXT:   next:2      X~~~~~~ error: no match found
; DUMP-ERR-NEXT:   >>>>>>