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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [dejagnu/] [testsuite/] [runtest.all/] [utils.test] - Blame information for rev 1774

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

Line No. Rev Author Line
1 578 markom
set srcdir [lindex $argv 0]
2
set subdir [lindex $argv 1]
3
set objdir [lindex $argv 2]
4
 
5
if [ file exists $objdir/setval.tmp ] {
6
    source $objdir/setval.tmp
7
} else {
8
    puts "ERROR: $objdir/setval.tmp doesn't exist"
9
}
10
if [ file exists $srcdir/$subdir/default_procs.tcl ] {
11
    source "$srcdir/$subdir/default_procs.tcl"
12
} else {
13
    puts "ERROR: $srcdir$subdir/default_procs.tcl doesn't exist"
14
}
15
 
16
set file $srcdir/../lib/utils.exp
17
if [ file exists $file] {
18
    source $file
19
} else {
20
    puts "ERROR: $file doesn't exist"
21
}
22
 
23
#
24
# getdirs tests
25
#
26
if [lib_pat_test "getdirs" "${srcdir}/runtest.all" "runtest.all/topdir" ] {
27
    puts "FAILED: getdirs toplevel, no arguments"
28
} else {
29
    puts "PASSED: getdirs toplevel, no arguments"
30
}
31
 
32
if [lib_pat_test "getdirs" "${srcdir}/runtest.all top*" "runtest.all/topdir" ] {
33
    puts "FAILED: getdirs toplevel, one subdir"
34
} else {
35
    puts "PASSED: getdirs toplevel, one subdir"
36
}
37
 
38
if [lib_pat_test "getdirs" "${srcdir}/runtest.all/topdir" "subdir1*subdir2" ] {
39
    puts "FAILED: getdirs toplevel, two subdirs"
40
} else {
41
    puts "PASSED: getdirs toplevel, two subdirs"
42
}
43
 
44
#
45
# find tests
46
#
47
if [string match "*/subdir2/subfile2" "[find ${srcdir}/runtest.all/topdir/subdir2 sub*]"] {
48
    puts "PASSED: find, only one level deep"
49
} else {
50
    puts "FAILED: find, only one level deep"
51
}
52
 
53
#set path ${srcdir}/runtest.all/topdir/subdir1
54
#exp_test "find ${path} sub*" "Adding */subdir1/subsubdir1/subsubfile1" "find, two levels deep"
55
 
56
if [string match "*/subdir1/subsubdir1/subsubfile1" "[find ${srcdir}/runtest.all/topdir/subdir1 sub*]"] {
57
    puts "PASSED: find, two levels deep"
58
} else {
59
    puts "FAILED: find, two  levels deep"
60
}
61
 
62
#
63
# environment varible utility tests
64
#
65
 
66
if [info exists env(TESTRUN)] {
67
    unset env(TESTRUN)
68
}
69
 
70
# test setenv
71
setenv TESTRUN FooBar
72
if [info exists env(TESTRUN)] {
73
    if { $env(TESTRUN) == "FooBar" } {
74
        pass "setenv, set an environment variable"
75
    } else {
76
        fail "setenv, set an environment variable
77
    }
78
} else {
79
    fail "setenv, set an environment variable"
80
}
81
# test getenv
82
if [info exists env(TESTRUN)] {
83
    if { [getenv TESTRUN] == "FooBar" } {
84
        pass "getenv, get an environment variable"
85
    } else {
86
        fail "getenv, get an environment variable"
87
    }
88
} else {
89
    untested "getenv, get an environment variable"
90
}
91
 
92
# test unsetenv
93
if [info exists env(TESTRUN)] {
94
    unsetenv TESTRUN
95
    if [info exists env(TESTRUN)] {
96
        fail "unsetenv, unset an environment variable"
97
    } else {
98
        pass "unsetenv, unset an environment variable"
99
    }
100
} else {
101
    untested "unsetenv, unset an environment variable"
102
}
103
 
104
# which file
105
# grep args
106
# prune list pattern
107
# slay name
108
# absolute path
109
# psource file
110
# diff file_1 file_2
111
 
112
 
113
 
114
 
115
 
116
 
117
 
118
 

powered by: WebSVN 2.1.0

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