URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/or1ksim/testsuite/lib
- from Rev 98 to Rev 99
- ↔ Reverse comparison
Rev 98 → Rev 99
/libsim.exp
68,23 → 68,46
send_user "matching |$matchstr|\n"; |
} |
|
# The matching is slightly tricky. In general we want to find warnings |
# or errors. However expect will look at the entire buffer, so if we |
# have the match string *after* an error or warning message, then the |
# match will still work OK. |
|
# The trick is to do some post-processing of the matched buffer to see |
# if there was a preceding Warning or ERROR message. |
|
expect { |
|
$matchstr { |
# String to match. Silently accept. Do first, so we can match |
# specific warnings or errors if desired |
} |
set matchlen [string length $matchstr] |
set buflen [string length $expect_out(buffer)] |
set lastch [expr {$buflen - $matchlen}] |
set prefix [string range $expect_out(buffer) 0 $lastch] |
|
-re "Warning" { |
fail "$testname: warning: $expect_out(buffer)"; |
return |
if { [string match *ERROR* $prefix] } { |
# We skipped an error |
fail "$testname: ERROR seeking match line $match_line"; |
return |
} elseif { [string match *Warning* $prefix] } { |
# We skipped a warning |
fail "$testname: Warning seeking match line $match_line"; |
return; |
} |
|
# Otherwise silently match |
} |
|
-re "ERROR" { |
fail "$testname: error: $expect_out(buffer)"; |
|
ERROR { |
# An error other than the one we seek |
fail "$testname: ERROR seeking match line $match_line"; |
return |
} |
|
|
Warning { |
# Any warning |
fail "$testname: Warning seeking match line $match_line"; |
return; |
} |
|
eof { |
fail "$testname: hit EOF seeking match line $match_line"; |
return |