mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
ef0283f95a
The old diagnostic form of the trace produced by -v and -vv looks like: ``` check1:1:8: remark: CHECK: expected string found in input CHECK: abc ^ <stdin>:1:3: note: found here ; abc def ^~~ ``` When dumping annotated input is requested (via -dump-input), I find that this old trace is not useful and is sometimes harmful: 1. The old trace is mostly redundant because the same basic information also appears in the input dump's annotations. 2. The old trace buries any error diagnostic between it and the input dump, but I find it useful to see any error diagnostic up front. 3. FILECHECK_OPTS=-dump-input=fail requests annotated input dumps only for failed FileCheck calls. However, I have to also add -v or -vv to get a full set of annotations, and that can produce massive output from all FileCheck calls in all tests. That's a real problem when I run this in the IDE I use, which grinds to a halt as it tries to capture all that output. When -dump-input=fail|always, this patch suppresses the old trace from -v or -vv. Error diagnostics still print as usual. If you want the old trace, perhaps to see variable expansions, you can set -dump-input=none (the default). Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D55825 llvm-svn: 351881
176 lines
6.7 KiB
Plaintext
176 lines
6.7 KiB
Plaintext
;--------------------------------------------------
|
|
; 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: FileCheck{{.*}}: 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: >>>>>>
|