diff options
author | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-20 23:29:56 +0000 |
---|---|---|
committer | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-20 23:29:56 +0000 |
commit | ad19092a9c46c43f1395af046936f36c4760709a (patch) | |
tree | aab72f92437c4dd0949a5bea81bc8904d77140fd /gcc/testsuite | |
parent | 63d003d8013c10e034996fea53542f48c20694ad (diff) | |
download | gcc-ad19092a9c46c43f1395af046936f36c4760709a.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135690 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-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 532eb7d67a6..ab4b65a5b69 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 9dde9004837..373052b4566 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" } } |