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

Subversion Repositories or1k_old

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

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/target.exp
17
if [ file exists $file] {
18
    source $file
19
} else {
20
    puts "ERROR: $file doesn't exist"
21
}
22
# we load framework so we can use stuff like is3way
23
set file $srcdir/../lib/framework.exp
24
if [ file exists $file] {
25
    source $file
26
} else {
27
    puts "ERROR: $file doesn't exist"
28
}
29
# we load the remote stuff so we can test execute_anywhere
30
set file $srcdir/../lib/remote.exp
31
if [ file exists $file] {
32
    source $file
33
} else {
34
    puts "ERROR: $file doesn't exist"
35
}
36
 
37
#
38
# Create a false target config array
39
#
40
set target_info(idp,name)       "idp"
41
set target_info(idp,ldflags)    "-Tidp.ld"
42
set target_info(idp,config)     m68k-unknown-aout
43
set target_info(idp,cflags)     ""
44
set target_info(idp,connect)    "telnet"
45
set target_info(idp,target)     "s12"
46
set target_info(idp,serial)     "tstty12"
47
set target_info(idp,netport)    "localhost:23"
48
set target_info(idp,baud)       "9600"
49
# MVME target
50
set target_info(mvme,name)      "mvme"
51
set target_info(mvme,ldflags)   "-Tmvme.ld"
52
set target_info(mvme,config)    m68k-unknown-aout
53
set target_info(mvme,cflags)    ""
54
set target_info(mvme,connect)   "telnet"
55
set target_info(mvme,target)    "s12"
56
set target_info(mvme,serial)    "tstty8"
57
set target_info(mvme,netport)   "localhost:23"
58
set target_info(mvme,baud)      "9600"
59
 
60
# Test remote open. We try not to use any of the support procs in
61
# target.exp to for isolation testing. "target" is the name of the
62
# default array setup by the procs in target.exp.
63
 
64
set timeout 100
65
 
66
# test list_target
67
 
68
if { [list_targets] == "idp mvme" } {
69
    puts "PASSED: list_targets"
70
} else {
71
    puts "FAILED: list_targets"
72
}
73
push_config target idp
74
set matches 0
75
if { $target_info(target,name) == "idp" } {
76
    incr matches
77
}
78
if { $target_info(target,ldflags) == "-Tidp.ld" } {
79
    incr matches
80
}
81
if { $target_info(target,config) == "m68k-unknown-aout" } {
82
    incr matches
83
}
84
if { $target_info(target,cflags) == "" } {
85
    incr matches
86
}
87
if { $target_info(target,connect) == "telnet" } {
88
    incr matches
89
}
90
if { $target_info(target,target) == "s12" } {
91
    incr matches
92
}
93
if { $target_info(target,serial) == "tstty12" } {
94
    incr matches
95
}
96
if { $target_info(target,netport) == "localhost:23" } {
97
    incr matches
98
}
99
if { $target_info(target,baud) == "9600" } {
100
    incr matches
101
}
102
if { $matches == 9 } {
103
    puts "PASSED: push_config target"
104
} else {
105
    puts "FAILED: push_config target"
106
}
107
 
108
# test pop_config target
109
pop_config target
110
set matches 0
111
if { $target_info(target,name) == "" } {
112
    incr matches
113
}
114
if { $target_info(target,ldflags) == "" } {
115
    incr matches
116
}
117
if { $target_info(target,config) == "" } {
118
    incr matches
119
}
120
if { $target_info(target,cflags) == "" } {
121
    incr matches
122
}
123
if { $target_info(target,connect) == "" } {
124
    incr matches
125
}
126
if { $target_info(target,target) == "" } {
127
    incr matches
128
}
129
if { $target_info(target,serial) == "" } {
130
    incr matches
131
}
132
if { $target_info(target,netport) == "" } {
133
    incr matches
134
}
135
if { $target_info(target,baud) == "" } {
136
    incr matches
137
}
138
if { $matches == 9 } {
139
    puts "PASSED: pop_config target"
140
} else {
141
    puts "FAILED: pop_config target"
142
}
143
 
144
push_config host idp
145
set matches 0
146
if { $target_info(host,name) == "idp" } {
147
    incr matches
148
}
149
if { $target_info(host,ldflags) == "-Tidp.ld" } {
150
    incr matches
151
}
152
if { $target_info(host,config) == "m68k-unknown-aout" } {
153
    incr matches
154
}
155
if { $target_info(host,cflags) == "" } {
156
    incr matches
157
}
158
if { $target_info(host,connect) == "telnet" } {
159
    incr matches
160
}
161
if { $target_info(host,target) == "s12" } {
162
    incr matches
163
}
164
if { $target_info(host,serial) == "tstty12" } {
165
    incr matches
166
}
167
if { $target_info(host,netport) == "localhost:23" } {
168
    incr matches
169
}
170
if { $target_info(host,baud) == "9600" } {
171
    incr matches
172
}
173
if { $matches == 9 } {
174
    puts "PASSED: push_config target"
175
} else {
176
    puts "FAILED: push_config target"
177
}
178
 
179
# test pop_config host
180
pop_config host
181
set matches 0
182
if { $target_info(host,name) == "" } {
183
    incr matches
184
}
185
if { $target_info(host,ldflags) == "" } {
186
    incr matches
187
}
188
if { $target_info(host,config) == "" } {
189
    incr matches
190
}
191
if { $target_info(host,cflags) == "" } {
192
    incr matches
193
}
194
if { $target_info(host,connect) == "" } {
195
    incr matches
196
}
197
if { $target_info(host,target) == "" } {
198
    incr matches
199
}
200
if { $target_info(host,serial) == "" } {
201
    incr matches
202
}
203
if { $target_info(host,netport) == "" } {
204
    incr matches
205
}
206
if { $target_info(host,baud) == "" } {
207
    incr matches
208
}
209
if { $matches == 9 } {
210
    puts "PASSED: pop_config host"
211
} else {
212
    puts "FAILED: pop_config host"
213
}
214
 
215
# test execute_anywhere for a native environment
216
set host_triplet i586-unknown-linux
217
set target_triplet i586-unknown-linux
218
set build_triplet i586-unknown-linux
219
if { [string match "*setval.tmp*" [execute_anywhere "ls"]] } {
220
    puts "PASSED: execute_anywhere, native"
221
} else {
222
    puts "FAILED: execute_anywhere, native"
223
}
224
 
225
# test execute_anywhere for a normal cross
226
set target_triplet m68k-unknown-coff
227
if { [string match "*testsuite" [execute_anywhere "pwd"]] } {
228
    puts "PASSED: execute_anywhere, normal cross"
229
} else {
230
    puts "FAILED: execute_anywhere, normal cross"
231
}
232
 
233
# test execute_anywhere for a canadian cross
234
set build_triplet m68k-test-test
235
set target_info(host,connect) rlogin
236
set target_info(host,netport) $target_info(idp,netport)
237
set target_info(host,target)  localhost
238
if { [string match "*FooBar*" [execute_anywhere "echo FooBar"]] } {
239
    puts "PASSED: execute_anywhere, canadian cross"
240
} else {
241
    puts "FAILED: execute_anywhere, canadian cross"
242
}
243
 
244
# compile arg
245
# archive arg
246
# ranlib arg
247
# link_objects arg

powered by: WebSVN 2.1.0

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