aboutsummaryrefslogtreecommitdiff
path: root/contrib/bluegnu2.0.3/testsuite/bluegnu.all/target.test
blob: 8c18980dd6ff53bb874d1e4636bdd3b428176bf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
set srcdir [lindex $argv 0]
set subdir [lindex $argv 1]
set objdir [lindex $argv 2]

if [ file exists $objdir/setval.tmp ] {
    source $objdir/setval.tmp
} else {
    puts "ERROR: $objdir/setval.tmp doesn't exist"
}
if [ file exists $srcdir$subdir/default_procs.tcl ] {
    source "$srcdir$subdir/default_procs.tcl"
} else {
    puts "ERROR: $srcdir$subdir/default_procs.tcl doesn't exist"
}

set file $srcdir/../lib/target.exp    
if [ file exists $file] {
    source $file
} else {
    puts "ERROR: $file doesn't exist"
}
# we load framework so we can use stuff like is3way
set file $srcdir/../lib/framework.exp    
if [ file exists $file] {
    source $file
} else {
    puts "ERROR: $file doesn't exist"
}
# we load the remote stuff so we can test execute_anywhere
set file $srcdir/../lib/remote.exp    
if [ file exists $file] {
    source $file
} else {
    puts "ERROR: $file doesn't exist"
}

#
# Create a false target config array
#
set target_info(idp,name)       "idp"
set target_info(idp,ldflags)    "-Tidp.ld"
set target_info(idp,config)     m68k-unknown-aout
set target_info(idp,cflags)     ""
set target_info(idp,connect)    "telnet"
set target_info(idp,target)     "s12"
set target_info(idp,serial)     "tstty12"
set target_info(idp,netport)    "localhost:23"
set target_info(idp,baud)       "9600"
# MVME target
set target_info(mvme,name)      "mvme"
set target_info(mvme,ldflags)   "-Tmvme.ld"
set target_info(mvme,config)    m68k-unknown-aout
set target_info(mvme,cflags)    ""
set target_info(mvme,connect)   "telnet"
set target_info(mvme,target)    "s12"
set target_info(mvme,serial)    "tstty8"
set target_info(mvme,netport)   "localhost:23"
set target_info(mvme,baud)      "9600"

# Test remote open. We try not to use any of the support procs in
# target.exp to for isolation testing. "target" is the name of the
# default array setup by the procs in target.exp.

set timeout 100

# test list_target

if { [list_targets] == "idp mvme" } {
    puts "PASSED: list_targets"
} else {
    puts "FAILED: list_targets"
}
push_config target idp
set matches 0
if { $target_info(target,name) == "idp" } {
    incr matches
}
if { $target_info(target,ldflags) == "-Tidp.ld" } {
    incr matches
}
if { $target_info(target,config) == "m68k-unknown-aout" } {
    incr matches
}
if { $target_info(target,cflags) == "" } {
    incr matches
}
if { $target_info(target,connect) == "telnet" } {
    incr matches
}
if { $target_info(target,target) == "s12" } {
    incr matches
}
if { $target_info(target,serial) == "tstty12" } {
    incr matches
}
if { $target_info(target,netport) == "localhost:23" } {
    incr matches
}
if { $target_info(target,baud) == "9600" } {
    incr matches
}
if { $matches == 9 } {
    puts "PASSED: push_config target"
} else {
    puts "FAILED: push_config target"
}

# test pop_config target
pop_config target
set matches 0
if { $target_info(target,name) == "" } {
    incr matches
}
if { $target_info(target,ldflags) == "" } {
    incr matches
}
if { $target_info(target,config) == "" } {
    incr matches
}
if { $target_info(target,cflags) == "" } {
    incr matches
}
if { $target_info(target,connect) == "" } {
    incr matches
}
if { $target_info(target,target) == "" } {
    incr matches
}
if { $target_info(target,serial) == "" } {
    incr matches
}
if { $target_info(target,netport) == "" } {
    incr matches
}
if { $target_info(target,baud) == "" } {
    incr matches
}
if { $matches == 9 } {
    puts "PASSED: pop_config target"
} else {
    puts "FAILED: pop_config target"
}

push_config host idp
set matches 0
if { $target_info(host,name) == "idp" } {
    incr matches
}
if { $target_info(host,ldflags) == "-Tidp.ld" } {
    incr matches
}
if { $target_info(host,config) == "m68k-unknown-aout" } {
    incr matches
}
if { $target_info(host,cflags) == "" } {
    incr matches
}
if { $target_info(host,connect) == "telnet" } {
    incr matches
}
if { $target_info(host,target) == "s12" } {
    incr matches
}
if { $target_info(host,serial) == "tstty12" } {
    incr matches
}
if { $target_info(host,netport) == "localhost:23" } {
    incr matches
}
if { $target_info(host,baud) == "9600" } {
    incr matches
}
if { $matches == 9 } {
    puts "PASSED: push_config target"
} else {
    puts "FAILED: push_config target"
}

# test pop_config host
pop_config host
set matches 0
if { $target_info(host,name) == "" } {
    incr matches
}
if { $target_info(host,ldflags) == "" } {
    incr matches
}
if { $target_info(host,config) == "" } {
    incr matches
}
if { $target_info(host,cflags) == "" } {
    incr matches
}
if { $target_info(host,connect) == "" } {
    incr matches
}
if { $target_info(host,target) == "" } {
    incr matches
}
if { $target_info(host,serial) == "" } {
    incr matches
}
if { $target_info(host,netport) == "" } {
    incr matches
}
if { $target_info(host,baud) == "" } {
    incr matches
}
if { $matches == 9 } {
    puts "PASSED: pop_config host"
} else {
    puts "FAILED: pop_config host"
}

# test execute_anywhere for a native environment
set host_triplet i586-unknown-linux
set target_triplet i586-unknown-linux
set build_triplet i586-unknown-linux
if { [string match "*setval.tmp*" [execute_anywhere "ls"]] } {
    puts "PASSED: execute_anywhere, native"
} else {
    puts "FAILED: execute_anywhere, native"
}

# test execute_anywhere for a normal cross
set target_triplet m68k-unknown-coff
if { [string match "*testsuite" [execute_anywhere "pwd"]] } {
    puts "PASSED: execute_anywhere, normal cross"
} else {
    puts "FAILED: execute_anywhere, normal cross"
}

# test execute_anywhere for a canadian cross
set build_triplet m68k-test-test
set target_info(host,connect) rlogin
set target_info(host,netport) $target_info(idp,netport)
set target_info(host,target)  localhost
if { [string match "*FooBar*" [execute_anywhere "echo FooBar"]] } {
    puts "PASSED: execute_anywhere, canadian cross"
} else {
    puts "FAILED: execute_anywhere, canadian cross"
}

# compile arg
# archive arg
# ranlib arg
# link_objects arg