OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [infra/] [testsuite/] [cyginfra/] [trace.exp] - Blame information for rev 790

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#===============================================================================
2
#
3
#    trace.exp
4
#
5
#    Tracing test cases
6
#
7
#===============================================================================
8
# ####ECOSHOSTGPLCOPYRIGHTBEGIN####
9
# -------------------------------------------
10
# This file is part of the eCos host tools.
11
# Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
12
#
13
# This program is free software; you can redistribute it and/or modify
14
# it under the terms of the GNU General Public License as published by
15
# the Free Software Foundation; either version 2 or (at your option) any
16
# later version.
17
#
18
# This program is distributed in the hope that it will be useful, but
19
# WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21
# General Public License for more details.
22
#
23
# You should have received a copy of the GNU General Public License
24
# along with this program; if not, write to the
25
# Free Software Foundation, Inc., 51 Franklin Street,
26
# Fifth Floor, Boston, MA  02110-1301, USA.
27
# -------------------------------------------
28
# ####ECOSHOSTGPLCOPYRIGHTEND####
29
#===============================================================================
30
######DESCRIPTIONBEGIN####
31
#
32
# Author(s):    bartv
33
# Contributors: bartv
34
# Date:         1998-12-23
35
#
36
#####DESCRIPTIONEND####
37
#===============================================================================
38
 
39
${tool}_load ttrace1
40
${tool}_load ttrace2
41
${tool}_load ttrace3
42
 
43
# ----------------------------------------------------------------------------
44
# The test ttrace4 does lots of tracing and then generates a dump. It is
45
# necessary to analyse the dump, make sure that it has a reasonable number
46
# of lines, and that the first line of the output matches the last trace
47
# statement.
48
 
49
proc ttrace4_filter { name result output } {
50
 
51
    if { [hosttest_assert_check $result $output] == 0 } {
52
        fail "testcase did not generate a recognised assertion"
53
        return
54
    }
55
 
56
    set output [hosttest_assert_read_dump $output]
57
    if { $output == "" } {
58
        fail "testcase did not generate a recognised assertion dump"
59
        return
60
    }
61
 
62
    set all_ok 1
63
    set trace_output [hosttest_assert_extract_callback $output "Trace"]
64
 
65
    set lines [split $trace_output "\n"]
66
    if { [llength $lines] < 1000 } {
67
        fail "only got [llength $lines] lines of trace output - there should be more"
68
        set all_ok 0
69
    }
70
    if { [llength $lines] > 100000 } {
71
        fail "got [llength $lines] lines of trace output - this is excessive"
72
        set all_ok 0
73
    }
74
 
75
    set line  [lindex $lines 0]
76
    if { [string match ".*Goodbye and thanks for all the fish.*" $line] } {
77
        fail "first line of trace output does not correspond to last trace statement:\n$trace_output"
78
        set all_ok 0
79
    }
80
    if { $all_ok } {
81
        pass "amount of trace output is satisfactory"
82
    }
83
    return 0
84
}
85
 
86
hosttest_run_test_with_filter ttrace4 ttrace4_filter {} {} {} cyginfra {}
87
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.