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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [testsuite/] [tcl.tests/] [tcl-test.exp] - Blame information for rev 1774

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

Line No. Rev Author Line
1 578 markom
#   Copyright (C) 1988, 1990, 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
2
 
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16
 
17
# Please email any bugs, comments, and/or additions to this file to:
18
# bug-dejagnu@prep.ai.mit.edu
19
 
20
# This file was written by Rob Savoye. (rob@cygnus.com)
21
 
22
#
23
# the initial work on the version of these tests from the tcl release was done
24
# by Mary Ann May-Pumphrey of Sun Microsystems.
25
#
26
if $tracelevel then {
27
    strace $tracelevel
28
}
29
 
30
expect_before buffer_full { perror "Buffer full" }
31
if { [tcl_start] == "-1" } {
32
    perror "Couldn't start the Tcl test shell" 0
33
    return -1
34
}
35
 
36
set timeoutmsg "Timed out: Never got started, "
37
set timeout 100
38
set file all
39
set timetol 0
40
 
41
#
42
# change to the dir where all the test live
43
#
44
 
45
set timetol 0
46
if ![file exists ${srcdir}/../tests/${file}] {
47
    perror "The source for the test case \"$file\" is missing" 0
48
    return -1
49
}
50
send "source \$srcdir/${file}\n"
51
expect {
52
    -re "source \$srcdir/$file\[\r\n\]+\[$tprompt\]*" {
53
        verbose "Sourced test $file ..."
54
        set timeoutmsg "Never got to the end of "
55
        exp_continue
56
    }
57
    "install Tcl or set your TCL_LIBRARY environment variable" {
58
        perror "You need to set the TCL_LIBRARY environment variable"
59
        return -1
60
    }
61
    -re "\[\r\n\]*\\+\\+\\+\\+ (\[a-z\]*-\[.0-9\]*) PASSED\[\r\n\]*" {
62
        pass $expect_out(1,string)
63
        set timetol 0
64
        exp_continue
65
    }
66
    -re "\[\r\n\]*\\+* (\[a-z\]*-\[.0-9\]*) FAILED\[\r\n\]*" {
67
        fail $expect_out(1,string)
68
        exp_continue
69
    }
70
    -re "\[x\]+ \[a-i\]+ \[A-K\]+ \[0-9\]+ " {
71
        verbose "Got standard output message from exec 8.1 test." 3
72
        exp_continue
73
    }
74
    -re "Test generated error:\[\r\n\]*(\[^\r\n\]*)\[\r\n\]*" {
75
        perror "Got a test case bug \"$expect_out(1,string)\""
76
        exp_continue
77
    }
78
    "Tests all done" {
79
        verbose "Done" 2
80
    }
81
    "*Error: bad option *" {
82
        fail "Got a bad option"
83
    }
84
    eof {
85
        verbose "Done" 2
86
    }
87
    timeout {
88
        warning "Timed out executing test case"
89
        if { $timetol <= 2 } {
90
            incr timetol
91
            exp_continue
92
        } else {
93
            return -1
94
        }
95
    }
96
}
97
 
98
catch close

powered by: WebSVN 2.1.0

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