1 #===============================================================================
7 #===============================================================================
8 ######COPYRIGHTBEGIN####
10 # ----------------------------------------------------------------------------
11 # Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
13 # This file is part of the eCos host tools.
15 # This program is free software; you can redistribute it and/or modify it
16 # under the terms of the GNU General Public License as published by the Free
17 # Software Foundation; either version 2 of the License, or (at your option)
20 # This program is distributed in the hope that it will be useful, but WITHOUT
21 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
25 # You should have received a copy of the GNU General Public License along with
26 # this program; if not, write to the Free Software Foundation, Inc.,
27 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 # ----------------------------------------------------------------------------
31 ######COPYRIGHTEND####
32 #===============================================================================
33 ######DESCRIPTIONBEGIN####
39 #####DESCRIPTIONEND####
40 #===============================================================================
46 # ----------------------------------------------------------------------------
47 # The test ttrace4 does lots of tracing and then generates a dump. It is
48 # necessary to analyse the dump, make sure that it has a reasonable number
49 # of lines, and that the first line of the output matches the last trace
52 proc ttrace4_filter { name result output } {
54 if { [hosttest_assert_check $result $output] == 0 } {
55 fail "testcase did not generate a recognised assertion"
59 set output [hosttest_assert_read_dump $output]
60 if { $output == "" } {
61 fail "testcase did not generate a recognised assertion dump"
66 set trace_output [hosttest_assert_extract_callback $output "Trace"]
68 set lines [split $trace_output "\n"]
69 if { [llength $lines] < 1000 } {
70 fail "only got [llength $lines] lines of trace output - there should be more"
73 if { [llength $lines] > 100000 } {
74 fail "got [llength $lines] lines of trace output - this is excessive"
78 set line [lindex $lines 0]
79 if { [string match ".*Goodbye and thanks for all the fish.*" $line] } {
80 fail "first line of trace output does not correspond to last trace statement:\n$trace_output"
84 pass "amount of trace output is satisfactory"
89 hosttest_run_test_with_filter ttrace4 ttrace4_filter {} {} {} cyginfra {}