diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2010-03-31 13:22:22 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2010-03-31 13:22:22 +0000 |
commit | 164de317d2fcb0bcecc203d57370b592b51270ae (patch) | |
tree | 279ceb2cb502c7510f523d98bdeec15c01ef446f /ld | |
parent | ff12863fb82c162de00f36bb96e416d5d2429f0f (diff) | |
download | gdb-164de317d2fcb0bcecc203d57370b592b51270ae.zip gdb-164de317d2fcb0bcecc203d57370b592b51270ae.tar.gz gdb-164de317d2fcb0bcecc203d57370b592b51270ae.tar.bz2 |
* lib/ld-lib.exp (run_dump_test): When checking linker message and
return code, when success with no message is expected, don't
continue if we have an abnormal exit with a message. Check output
of inspection program and fail if it had output or an abnormal
exit code. Include "warning" and "error" among the directives
where multiples are allowed and append to previous values.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | ld/testsuite/lib/ld-lib.exp | 18 |
2 files changed, 19 insertions, 6 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 039b999..c2c6d46 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,5 +1,12 @@ 2010-03-31 Hans-Peter Nilsson <hp@axis.com> + * lib/ld-lib.exp (run_dump_test): When checking linker message and + return code, when success with no message is expected, don't + continue if we have an abnormal exit with a message. Check output + of inspection program and fail if it had output or an abnormal + exit code. Include "warning" and "error" among the directives + where multiples are allowed and append to previous values. + * ld-cris/cris.exp (loop over $srcdir/$subdir/*dso-*.d): Apply "file rootname", not "file tail", before applying runtest_file_p. diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 924d5ef..5b2e62b 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -654,11 +654,13 @@ proc simple_diff { file_1 file_2 } { # error: REGEX # An error with message matching REGEX must be emitted for the test # to pass. The PROG, objdump, nm and objcopy options have no -# meaning and need not supplied if this is present. +# meaning and need not supplied if this is present. Multiple "error" +# directives append to the expected linker error message. # # warning: REGEX # Expect a linker warning matching REGEX. It is an error to issue -# both "error" and "warning". +# both "error" and "warning". Multiple "warning" directives +# append to the expected linker warning message. # # Each option may occur at most once unless otherwise mentioned. # @@ -725,6 +727,8 @@ proc run_dump_test { name } { xfail {} target {} notarget {} + warning {} + error {} source { # Move any source-specific as-flags to a separate array to # simplify processing. @@ -925,8 +929,9 @@ proc run_dump_test { name } { send_log "$comp_output\n" verbose "$comp_output" 3 - if { [regexp $expmsg $comp_output] \ - && (($cmdret == 0) == ($opts(warning) != "")) } { + if { ($expmsg == "") == ($comp_output == "") \ + && [regexp $expmsg $comp_output] \ + && (($cmdret == 0) == ($opts(error) == "")) } { # We have the expected output from ld. if { $opts(error) != "" || $program == "" } { pass $testname @@ -974,6 +979,7 @@ proc run_dump_test { name } { set env(LC_ALL) "C" send_log "$cmd\n" set cmdret [remote_exec host [concat sh -c [list "$cmd 2>ld.tmp"]] "" "/dev/null"] + set cmdret [lindex $cmdret 0] remote_upload host "ld.tmp" set comp_output [prune_warnings [file_contents "ld.tmp"]] remote_file host delete "ld.tmp" @@ -983,8 +989,8 @@ proc run_dump_test { name } { } else { unset env(LC_ALL) } - if ![string match "" $comp_output] then { - send_log "$comp_output\n" + if { $cmdret != 0 || $comp_output != "" } { + send_log "exited abnormally with $cmdret, output:$comp_output\n" fail $testname return } |