diff options
author | Janis Johnson <janis187@us.ibm.com> | 2008-05-20 23:29:56 +0000 |
---|---|---|
committer | Janis Johnson <janis@gcc.gnu.org> | 2008-05-20 23:29:56 +0000 |
commit | 66d0be855a9ca97a0698f46ebb861c64b018d359 (patch) | |
tree | aab72f92437c4dd0949a5bea81bc8904d77140fd /gcc | |
parent | 8a93eaf25ec07269ee7c47641317a640a9ac2964 (diff) | |
download | gcc-66d0be855a9ca97a0698f46ebb861c64b018d359.zip gcc-66d0be855a9ca97a0698f46ebb861c64b018d359.tar.gz gcc-66d0be855a9ca97a0698f46ebb861c64b018d359.tar.bz2 |
scandump.exp (scan-dump): Handle non-existent dump file.
* lib/scandump.exp (scan-dump): Handle non-existent dump file.
(scan-dump-times): Ditto.
(scan-dump-not): Ditto.
(scan-dump-dem): Ditto.
(scan-dump-dem-not): Ditto.
From-SVN: r135690
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/lib/scandump.exp | 67 |
2 files changed, 53 insertions, 20 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 532eb7d..ab4b65a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2008-05-20 Janis Johnson <janis187@us.ibm.com> + * lib/scandump.exp (scan-dump): Handle non-existent dump file. + (scan-dump-times): Ditto. + (scan-dump-not): Ditto. + (scan-dump-dem): Ditto. + (scan-dump-dem-not): Ditto. + * obj-c++.dg/bitfield-1.mm: XFAIL for ICE; move dg-options after other test directives; use dg-prune-output instead of dg-excess-errors for possible message to ignore; adjust line numbers for messages. diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp index 9dde900..373052b 100644 --- a/gcc/testsuite/lib/scandump.exp +++ b/gcc/testsuite/lib/scandump.exp @@ -49,18 +49,23 @@ proc scan-dump { args } { # A cleaner solution would require a new DejaGnu release. upvar 3 name testcase + set suf [dump-suffix [lindex $args 2]] + set testname "$testcase scan-[lindex $args 0]-dump $suf \"[lindex $args 1]\"" set src [file tail [lindex $testcase 0]] - set output_file "[glob $src.[lindex $args 2]]" + set output_file "[glob -nocomplain $src.[lindex $args 2]]" + if { $output_file == "" } { + fail "$testname: dump file does not exist" + return + } set fd [open $output_file r] 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 $suf \"[lindex $args 1]\"" + pass "$testname" } else { - fail "$testcase scan-[lindex $args 0]-dump $suf \"[lindex $args 1]\"" + fail "$testname" } } @@ -86,18 +91,23 @@ proc scan-dump-times { args } { # A cleaner solution would require a new DejaGnu release. upvar 3 name testcase + set suf [dump-suffix [lindex $args 3]] + set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"[lindex $args 1]\" [lindex $args 2]" set src [file tail [lindex $testcase 0]] - set output_file "[glob $src.[lindex $args 3]]" + set output_file "[glob -nocomplain $src.[lindex $args 3]]" + if { $output_file == "" } { + fail "$testname: dump file does not exist" + return + } set fd [open $output_file r] 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 $suf \"[lindex $args 1]\" [lindex $args 2]" + pass "$testname" } else { - fail "$testcase scan-[lindex $args 0]-dump-times $suf \"[lindex $args 1]\" [lindex $args 2]" + fail "$testname" } } @@ -122,18 +132,24 @@ proc scan-dump-not { args } { # it still stores the filename of the testcase in a local variable "name". # A cleaner solution would require a new DejaGnu release. upvar 3 name testcase + + set suf [dump-suffix [lindex $args 2]] + set testname "$testcase scan-[lindex $args 0]-dump-not $suf \"[lindex $args 1]\"" set src [file tail [lindex $testcase 0]] - set output_file "[glob $src.[lindex $args 2]]" + set output_file "[glob -nocomplain $src.[lindex $args 2]]" + if { $output_file == "" } { + fail "$testname: dump file does not exist" + return + } set fd [open $output_file r] 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 $suf \"[lindex $args 1]\"" + pass "$testname" } else { - fail "$testcase scan-[lindex $args 0]-dump-not $suf \"[lindex $args 1]\"" + fail "$testname" } } @@ -168,18 +184,23 @@ proc scan-dump-dem { args } { } upvar 3 name testcase + set suf [dump-suffix [lindex $args 2]] + set testname "$testcase scan-[lindex $args 0]-dump-dem $suf \"[lindex $args 1]\"" set src [file tail [lindex $testcase 0]] - set output_file "[glob $src.[lindex $args 2]]" + set output_file "[glob -nocomplain $src.[lindex $args 2]]" + if { $output_file == "" } { + fail "$testname: dump file does not exist" + return + } set fd [open "| $cxxfilt < $output_file" r] 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 $suf \"[lindex $args 1]\"" + pass "$testname" } else { - fail "$testcase scan-[lindex $args 0]-dump-dem $suf \"[lindex $args 1]\"" + fail "$testname" } } @@ -213,17 +234,23 @@ proc scan-dump-dem-not { args } { } upvar 3 name testcase + + set suf [dump-suffix [lindex $args 2]] + set testname "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"[lindex $args 1]\"" set src [file tail [lindex $testcase 0]] - set output_file "[glob $src.[lindex $args 2]]" + set output_file "[glob -nocomplain $src.[lindex $args 2]]" + if { $output_file == "" } { + fail "$testname: dump file does not exist" + return + } set fd [open "| $cxxfilt < $output_file" r] 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 $suf \"[lindex $args 1]\"" + pass "$testname" } else { - fail "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"[lindex $args 1]\"" + fail "$testname" } } |