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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [expect/] [testsuite/] [expect.tests/] [expect-tests.exp] - Blame information for rev 1776

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 { error "Buffer full" }
31
expect_start
32
 
33
set timeoutmsg "Timed out: Never got started, "
34
set timeout 20
35
set file all
36
set command "unidentified test in $file"
37
 
38
if ![file exists ${srcdir}/../tests] {
39
    perror "The source for the test cases is missing." 0
40
    return -1
41
}
42
send "cd ${srcdir}/../tests\r"
43
expect {
44
    -re "set VERBOSE 1\[\r\n\]*1\[\r\n\]*$eprompt" {
45
        verbose "Set verbose flag for tests"
46
        exp_continue
47
    }
48
    -re "cd $srcdir/../tests\[\r\n\]*$eprompt" {
49
        verbose "Changed directory to $srcdir/../tests" 2
50
    }
51
    -re "no files matched glob pattern" {
52
        warning "Didn't cd to $srcdir/../tests"
53
    }
54
    timeout {
55
        perror "Couldn't change directories" 0
56
        return -1
57
    }
58
}
59
 
60
exp_send "source $file\r"
61
expect {
62
    -re "source $file\[\r\n\]*$eprompt" {
63
        verbose "Sourced test $file ..."
64
        set timeoutmsg "Never got to the end of "
65
        exp_continue
66
    }
67
    "install Tcl or set your TCL_LIBRARY environment variable" {
68
        perror "You need to set the TCL_LIBRARY environment variable"
69
        return -1
70
    }
71
    -re "no files matched glob pattern" {
72
        warning "Didn't cd to $srcdir/../tests"
73
    }
74
    -re "\[\r\n\]*\\+\\+\\+\\+ (\[a-z\]*-\[.0-9\]*) PASSED\[\r\n\]*" {
75
        pass $expect_out(1,string)
76
        exp_continue
77
    }
78
    -re "\[\r\n\]*\\+* (\[a-z\]*-\[.0-9\]*) FAILED\[\r\n\]*" {
79
        fail $expect_out(1,string)
80
        exp_continue
81
    }
82
    -re "Test generated error:\[\r\n\]*.*\[\r\n\]*" {
83
        regsub "Test generated error:\[\r\n\]+" $expect_out(0,string) "" tmp
84
        regsub -all "\[\r\n\]*\[a-z.\]test\[\r\n\]*" $tmp "" tmp
85
        regsub -all "\[\r\n\]*" $tmp "" tmp
86
        perror "Got a test case bug \"$tmp\""
87
        exp_continue
88
    }
89
    -re "\[x\]+ \[a-i\]+ \[A-K\]+ \[0-9\]+ " {
90
        verbose "Got standard output message from exec 8.1 test." 3
91
        exp_continue
92
    }
93
    "*Error: bad option *" {
94
        fail "$command (Got a bad option)"
95
    }
96
    eof {
97
        verbose "Done" 2
98
    }
99
    timeout {
100
        warning "$timeoutmsg $file"
101
    }
102
}
103
 
104
catch close

powered by: WebSVN 2.1.0

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