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
|
# Test procedures in lib/target.exp. -*- Tcl -*-
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"
}
proc load_lib { lib } {
global srcdir
source $srcdir/../lib/$lib
}
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 board config array
#
set board_info(idp,name) "idp"
set board_info(idp,ldflags) "-Tidp.ld"
set board_info(idp,config) m68k-unknown-aout
set board_info(idp,cflags) ""
set board_info(idp,connect) "telnet"
set board_info(idp,target) "s12"
set board_info(idp,serial) "tstty12"
set board_info(idp,netport) "localhost:23"
set board_info(idp,baud) "9600"
# MVME target
set board_info(mvme,name) "mvme"
set board_info(mvme,ldflags) "-Tmvme.ld"
set board_info(mvme,config) m68k-unknown-aout
set board_info(mvme,cflags) ""
set board_info(mvme,connect) "telnet"
set board_info(mvme,target) "s12"
set board_info(mvme,serial) "tstty8"
set board_info(mvme,netport) "localhost:23"
set board_info(mvme,baud) "9600"
# test push_config target
push_config target idp
if { $target_info(target,name) eq "idp" } {
puts "PASSED: push_config target"
} else {
puts "FAILED: push_config target"
}
# test pop_config target
pop_config target
if { ![info exists target_info(target,name)] } {
puts "PASSED: pop_config target"
} else {
puts "FAILED: pop_config target"
}
push_config host idp
if { $target_info(host,name) eq "idp" } {
puts "PASSED: push_config target"
} else {
puts "FAILED: push_config target"
}
# test pop_config host
pop_config host
if { ![info exists target_info(host,name)] } {
puts "PASSED: pop_config host"
} else {
puts "FAILED: pop_config host"
}
puts "END target.test"
|