diff options
author | Alan Modra <amodra@gmail.com> | 2025-01-18 22:21:03 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2025-01-21 08:42:44 +1030 |
commit | 592819f7188509713f3db6dbe6bc7d0b7e3af89e (patch) | |
tree | 5357de8109b21aabaa2bbfd5273d0f52b0c2a5bd /binutils/testsuite | |
parent | bea261b937df4d7c5168cdfe82cd06d1f1b74d27 (diff) | |
download | binutils-592819f7188509713f3db6dbe6bc7d0b7e3af89e.zip binutils-592819f7188509713f3db6dbe6bc7d0b7e3af89e.tar.gz binutils-592819f7188509713f3db6dbe6bc7d0b7e3af89e.tar.bz2 |
run_dump_test warning/error regexp
This allows you to specify a run_dump_test warning that may or may not
be present using
warning: (warning_text_goes_here)?
ie. the regexp matches an empty string.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r-- | binutils/testsuite/lib/binutils-common.exp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp index 72664d8..41d94d2 100644 --- a/binutils/testsuite/lib/binutils-common.exp +++ b/binutils/testsuite/lib/binutils-common.exp @@ -1567,12 +1567,16 @@ proc run_dump_test { name {extra_options {}} } { verbose -log "$exitstat with: <$comp_output>, no expected output" } - if { (($want_out(source) == "") == ($comp_output == "")) \ - && (($cmdret == 0) == ($want_out(terminal) == 0)) \ - && ((($want_out(source) == "regex") \ - && [regexp -- $want_out(regex) $comp_output]) \ - || (($want_out(source) == "file") \ - && (![regexp_diff "tmpdir/ld.messages" "$srcdir/$subdir/$want_out(file)"]))) } { + set ok 0 + if { ($cmdret == 0) == ($want_out(terminal) == 0) } { + switch $want_out(source) { + regex { set ok [regexp -- $want_out(regex) $comp_output] } + file { set ok [expr ![regexp_diff tmpdir/ld.messages \ + $srcdir/$subdir/$want_out(file)]] } + "" { set ok [string equal $comp_output ""] } + } + } + if { $ok } { # We have the expected output. if { $want_out(terminal) || $dumpprogram == "" } { pass $testname |