aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-10-17 09:31:30 +0200
committerMartin Liska <marxin@gcc.gnu.org>2017-10-17 07:31:30 +0000
commit7a76132c80a7a5b832c93bf1ff44e14720d54a33 (patch)
tree8c5848c4b2a14cdb014159f2d64538ea61fb3989
parentaf297249647b4d5b783239916f27a4b68829f916 (diff)
downloadgcc-7a76132c80a7a5b832c93bf1ff44e14720d54a33.zip
gcc-7a76132c80a7a5b832c93bf1ff44e14720d54a33.tar.gz
gcc-7a76132c80a7a5b832c93bf1ff44e14720d54a33.tar.bz2
Improve FAIL message for dump-*-times functions.
2017-10-17 Martin Liska <mliska@suse.cz> * lib/scanasm.exp: Print how many times a regex pattern is found. * lib/scandump.exp: Likewise. From-SVN: r253804
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/lib/scanasm.exp10
-rw-r--r--gcc/testsuite/lib/scandump.exp6
3 files changed, 16 insertions, 6 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3059d23..5c3c5b2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-17 Martin Liska <mliska@suse.cz>
+
+ * lib/scanasm.exp: Print how many times a regex pattern is
+ found.
+ * lib/scandump.exp: Likewise.
+
17-10-2017 Olga Makhotina <olga.makhotina@intel.com>
* gcc.target/i386/avx512dq-vreducesd-1.c (_mm_mask_reduce_sd,
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index bab23e8..32764cb 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -231,6 +231,7 @@ proc scan-assembler-times { args } {
set testcase [testname-for-summary]
set pattern [lindex $args 0]
+ set times [lindex $args 1]
set pp_pattern [make_pattern_printable $pattern]
# This must match the rule in gcc-dg.exp.
@@ -239,7 +240,7 @@ proc scan-assembler-times { args } {
set files [glob -nocomplain $output_file]
if { $files == "" } {
verbose -log "$testcase: output file does not exist"
- unresolved "$testcase scan-assembler-times $pp_pattern [lindex $args 1]"
+ unresolved "$testcase scan-assembler-times $pp_pattern $times"
return
}
@@ -247,10 +248,11 @@ proc scan-assembler-times { args } {
set text [read $fd]
close $fd
- if { [llength [regexp -inline -all -- $pattern $text]] == [lindex $args 1]} {
- pass "$testcase scan-assembler-times $pp_pattern [lindex $args 1]"
+ set result_count [llength [regexp -inline -all -- $pattern $text]]
+ if {$result_count == $times} {
+ pass "$testcase scan-assembler-times $pp_pattern $times"
} else {
- fail "$testcase scan-assembler-times $pp_pattern [lindex $args 1]"
+ fail "$testcase scan-assembler-times $pp_pattern $times (found $result_count times)"
}
}
diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp
index 2e6eebf..4a64ac6 100644
--- a/gcc/testsuite/lib/scandump.exp
+++ b/gcc/testsuite/lib/scandump.exp
@@ -86,6 +86,7 @@ proc scan-dump-times { args } {
}
set testcase [testname-for-summary]
+ set times [lindex $args 2]
set suf [dump-suffix [lindex $args 3]]
set printable_pattern [make_pattern_printable [lindex $args 1]]
set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"$printable_pattern\" [lindex $args 2]"
@@ -101,10 +102,11 @@ proc scan-dump-times { args } {
set text [read $fd]
close $fd
- if { [llength [regexp -inline -all -- [lindex $args 1] $text]] == [lindex $args 2]} {
+ set result_count [llength [regexp -inline -all -- [lindex $args 1] $text]]
+ if {$result_count == $times} {
pass "$testname"
} else {
- fail "$testname"
+ fail "$testname (found $result_count times)"
}
}