Commit df2cfe86 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(MEMTRACE): Default to /dev/null.

(simple_expect): Recognize attempts to match protcol-A replies,
	and fail without a timeout if the correct reference number is
	returned with bogus data.
parent 0c78bbfe
......@@ -7,7 +7,7 @@ set efence 0
# Set MEMTRACE to the file where the trace should be sent.
# This is typically the tty where you are running the attached gdb.
# set MEMTRACE /dev/null
set MEMTRACE /dev/null
# Set the timeout value to something small for quicker testing
# set timeout 5
......@@ -129,11 +129,27 @@ proc simple_expect {regex {testname ""} {is_meta ""}} {
if {$test == ""} {
set test "looking for $regex"
}
expect {
-re "^$ll$regex$nl" {pass "$test"}
timeout {fail "$test (timeout)"}
eof {fail "$test (eof)"; wait}
buffer_full {fail "$test (buffer_full)"}
if {[regexp "^(\[=%\])(\[0-9\]*)(( )(..*))?$" "$regex" all a refno]} {
# This looks like a protocol A reply.
expect {
-re "^$ll$regex$nl" {pass "$test"}
-re "^$ll=$refno$nl" {fail "$test (unexpected reply =$refno)"}
-re "^${ll}(\[=%\]$refno $any*)$nl" {
fail "$test (unexpected reply $expect_out(1,string))"
}
timeout {fail "$test (timeout)"}
eof {fail "$test (eof)"; wait}
buffer_full {fail "$test (buffer_full)"}
}
} else {
expect {
-re "^$ll$regex$nl" {pass "$test"}
timeout {fail "$test (timeout)"}
eof {fail "$test (eof)"; wait}
buffer_full {fail "$test (buffer_full)"}
}
}
unset test
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment