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

Subversion Repositories or1k

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

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

Line No. Rev Author Line
1 578 markom
#   Copyright (C) 1996 Cygnus Support
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 Tom Tromey 
21
 
22
if {$tracelevel} then {
23
  strace $tracelevel
24
}
25
 
26
if {[tk_start] == -1} then {
27
  perror "Couldn't start the Tk test environment" 0
28
  return -1
29
}
30
 
31
# This file is needed by the Tk test suite.
32
copy_file $srcdir/../tests/README README
33
 
34
set timeoutmsg "Timed out: Never got started, "
35
set timeout 100
36
set file all
37
set timetol 0
38
 
39
#
40
# Change to the dir where all the tests live.
41
#
42
 
43
set timetol 0
44
if {! [file exists ${srcdir}/../tests/${file}]} then {
45
  perror "The source for the test case \"$file\" is missing" 0
46
  return -1
47
}
48
send "source \$srcdir/${file}\n"
49
expect {
50
  -re "source \$srcdir/$file\[\r\n\]+\[$tprompt\]*" {
51
    verbose "Sourced test $file ..."
52
    set timeoutmsg "Never got to the end of "
53
    exp_continue
54
  }
55
  "install Tcl or set your TCL_LIBRARY environment variable" {
56
    perror "You need to set the TCL_LIBRARY environment variable"
57
    return -1
58
  }
59
  -re "\[\r\n\]*\\+\\+\\+\\+ (\[a-zA-Z\]*-\[.0-9\]*) PASSED\[\r\n\]*" {
60
    pass $expect_out(1,string)
61
    set timetol 0
62
    exp_continue
63
  }
64
  -re "\[\r\n\]*\\+* (\[a-zA-Z\]*-\[.0-9\]*) FAILED\[\r\n\]*" {
65
    fail $expect_out(1,string)
66
    exp_continue
67
  }
68
  -re "\[x\]+ \[a-i\]+ \[A-K\]+ \[0-9\]+ " {
69
    verbose "Got standard output message from exec 8.1 test." 3
70
    exp_continue
71
  }
72
  -re "Test generated error:\[\r\n\]*.*\[\r\n\]*" {
73
    regsub "Test generated error:\[\r\n\]*" $expect_out(0,string) "" tmp
74
    regsub -all "\[\r\n\]*\[a-zA-Z.\]test\[\r\n\]*" $tmp "" tmp
75
    regsub -all "\[\r\n\]*" $tmp "" tmp
76
    perror "Got a test case bug \"$tmp\""
77
    exp_continue
78
  }
79
  "Tests all done" {
80
    verbose "Done" 2
81
  }
82
  "*Error: bad option *" {
83
    fail "Got a bad option"
84
  }
85
  eof {
86
    verbose "Done" 2
87
  }
88
  timeout {
89
    warning "Timed out executing test case"
90
    if { $timetol <= 2 } {
91
      incr timetol
92
      exp_continue
93
    } else {
94
      return -1
95
    }
96
  }
97
}
98
 
99
catch close

powered by: WebSVN 2.1.0

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