mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00:00
Fix compare_output_to in run tool (fix #162)
In the compare_output_to function in the run tool a check was introduced, whether the given arguments are empty, and if so if the output string is it too. Without this patch compare_output_to succeeded when the given pattern was empty but output wasn't. Please refer to issue #162.
This commit is contained in:
parent
d287b9d893
commit
e88276bf0e
15
tool/run
15
tool/run
@ -188,6 +188,21 @@ proc compare_output_to { good } {
|
||||
incr i
|
||||
}
|
||||
|
||||
#
|
||||
# if $good is empty the foreach-loop isn't entered
|
||||
# so we've to check for it separately
|
||||
#
|
||||
if {![llength $good_list] && [llength $output_list]} {
|
||||
foreach output_line $output_list {
|
||||
set output_line [strip_whitespace $output_line]
|
||||
puts ""
|
||||
puts stderr "Line $i of output is unexpected"
|
||||
puts stderr " got: '$output_line'"
|
||||
incr mismatch_cnt
|
||||
incr i
|
||||
}
|
||||
}
|
||||
|
||||
if {$mismatch_cnt > 0} {
|
||||
puts "Error: Test failed, $mismatch_cnt unexpected lines of output"
|
||||
exit -1
|
||||
|
Loading…
Reference in New Issue
Block a user