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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [insight/] [dejagnu/] [testsuite/] [runtest.all/] [libs.exp] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#   Copyright (C) 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
 
17
# Please email any bugs, comments, and/or additions to this file to:
18
# DejaGnu@cygnus.com
19
 
20
load_lib libsup.exp
21
 
22
proc process_test { test } {
23
    global srcdir
24
    global subdir
25
    global objdir
26
    global EXPECT
27
 
28
    verbose "Executing test case $test"
29
    set text "\[- A-Za-z0-9\,\.\;\"\_\:\'\`\(\)\!\#\=\+\?\&\*]*"
30
 
31
    set timeout 150
32
 
33
    if [file exists $test] {
34
        verbose "Processing test $test" 2
35
        spawn -open  [open "|$EXPECT $test $srcdir $subdir [pwd]" r]
36
        expect {
37
            "No such file or directory" {
38
                perror "$test wouldn't run" 0
39
            }
40
            -re "\[\r\n\]*NOTSUPPORTED: $text\[\r\n\]*" {
41
                unsupported "[lrange $expect_out(0,string) 1 end]"
42
                exp_continue
43
            }
44
            -re "\[\r\n\]*NOTTESTED: $text\[\r\n\]*" {
45
                untested "[lrange $expect_out(0,string) 1 end]"
46
                exp_continue
47
            }
48
            -re "\[\r\n\]*PASSED: $text\[\r\n\]*" {
49
                pass "[lrange $expect_out(0,string) 1 end]"
50
                exp_continue
51
            }
52
            -re "\[\r\n\]*FAILED: $text\[\r\n\]*" {
53
                fail "[lrange $expect_out(0,string) 1 end]"
54
                exp_continue
55
            }
56
            -re "\[\r\n\]*WARNED: $text\[\r\n\]*" {
57
                verbose "$expect_out(0,string)" 2
58
                exp_continue
59
            }
60
            -re "\[\r\n\]*ERRORED: $text\[\r\n\]*" {
61
                verbose "$expect_out(0,string)" 2
62
                exp_continue
63
            }
64
            timeout {
65
                perror "$test timed out" 0
66
                exp_continue
67
            }
68
            eof {
69
                verbose "All Done" 3
70
            }
71
        }
72
    } else {
73
        perror "$test doesn't exist" 0
74
    }
75
}
76
 
77
if ![info exists EXPECT] {
78
    set EXPECT [findfile $base_dir/../../expect/expect "$base_dir/../../expect/expect" expect]
79
    verbose "EXPECT defaulting to $EXPECT" 2
80
}
81
 
82
make_defaults_file [pwd]/setval.tmp
83
 
84
foreach i [glob $srcdir/$subdir/*.test] {
85
    process_test $i
86
}
87
 
88
 
89
 
90
 
91
 
92
 

powered by: WebSVN 2.1.0

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