This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC/TESTSUITE] include dump suffix in scan-dump pass/fail messages
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: pinskia at gmail dot com, mrs at apple dot com, joseph at codesourcery dot com
- Date: Tue, 12 Jun 2007 12:06:14 -0700
- Subject: [RFC/TESTSUITE] include dump suffix in scan-dump pass/fail messages
- Reply-to: janis187 at us dot ibm dot com
This patch adds the constant part of the dump file suffix to the pass/fail
message for scan-dump and friends. That changes the message sufficiently
that I also put quotes around the regular expression, making lines that
also include counts a bit easier to read.
This patch fixes the problem reported in PR32076, but it will break test
result comparisons for results from before and after this patch. Is that
acceptable to people who use contrib/compare_tests regularly?
2007-06-12 Janis Johnson <janis187@us.ibm.com>
PR testsuite/32076
* lib/scandump.exp (dump-suffix): New.
(scan-dump, scan-dump-times, scan-dump-dem, scan-dump-dem-not):
Include dump suffix in pass/fail messages, put regexp in quotes.
Index: gcc/testsuite/lib/scandump.exp
===================================================================
--- gcc/testsuite/lib/scandump.exp (revision 125610)
+++ gcc/testsuite/lib/scandump.exp (working copy)
@@ -19,6 +19,13 @@
#
# This is largely borrowed from scanasm.exp.
+# Extract the constant part of the dump file suffix from the regexp.
+# Argument 0 is the regular expression.
+proc dump-suffix { arg } {
+ set idx [expr [string last "." $arg] + 1]
+ return [string range $arg $idx end]
+}
+
# Utility for scanning compiler result, invoked via dg-final.
# Call pass if pattern is present, otherwise fail.
#
@@ -49,10 +56,11 @@
set text [read $fd]
close $fd
+ set suf [dump-suffix [lindex $args 2]]
if [regexp -- [lindex $args 1] $text] {
- pass "$testcase scan-[lindex $args 0]-dump [lindex $args 1]"
+ pass "$testcase scan-[lindex $args 0]-dump $suf \"[lindex $args 1]\""
} else {
- fail "$testcase scan-[lindex $args 0]-dump [lindex $args 1]"
+ fail "$testcase scan-[lindex $args 0]-dump $suf \"[lindex $args 1]\""
}
}
@@ -85,10 +93,11 @@
set text [read $fd]
close $fd
+ set suf [dump-suffix [lindex $args 3]]
if { [llength [regexp -inline -all -- [lindex $args 1] $text]] == [lindex $args 2]} {
- pass "$testcase scan-[lindex $args 0]-dump-times [lindex $args 1] [lindex $args 2]"
+ pass "$testcase scan-[lindex $args 0]-dump-times $suf \"[lindex $args 1]\" [lindex $args 2]"
} else {
- fail "$testcase scan-[lindex $args 0]-dump-times [lindex $args 1] [lindex $args 2]"
+ fail "$testcase scan-[lindex $args 0]-dump-times $suf \"[lindex $args 1]\" [lindex $args 2]"
}
}
@@ -120,10 +129,11 @@
set text [read $fd]
close $fd
+ set suf [dump-suffix [lindex $args 2]]
if ![regexp -- [lindex $args 1] $text] {
- pass "$testcase scan-[lindex $args 0]-dump-not [lindex $args 1]"
+ pass "$testcase scan-[lindex $args 0]-dump-not $suf \"[lindex $args 1]\""
} else {
- fail "$testcase scan-[lindex $args 0]-dump-not [lindex $args 1]"
+ fail "$testcase scan-[lindex $args 0]-dump-not $suf \"[lindex $args 1]\""
}
}
@@ -165,10 +175,11 @@
set text [read $fd]
close $fd
+ set suf [dump-suffix [lindex $args 2]]
if [regexp -- [lindex $args 1] $text] {
- pass "$testcase scan-[lindex $args 0]-dump-dem [lindex $args 1]"
+ pass "$testcase scan-[lindex $args 0]-dump-dem $suf \"[lindex $args 1]\""
} else {
- fail "$testcase scan-[lindex $args 0]-dump-dem [lindex $args 1]"
+ fail "$testcase scan-[lindex $args 0]-dump-dem $suf \"[lindex $args 1]\""
}
}
@@ -209,9 +220,10 @@
set text [read $fd]
close $fd
+ set suf [dump-suffix [lindex $args 2]]
if ![regexp -- [lindex $args 1] $text] {
- pass "$testcase scan-[lindex $args 0]-dump-dem-not [lindex $args 1]"
+ pass "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"[lindex $args 1]\""
} else {
- fail "$testcase scan-[lindex $args 0]-dump-dem-not [lindex $args 1]"
+ fail "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"[lindex $args 1]\""
}
}