aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2017-06-04 14:07:16 +1000
committerBen Elliston <bje@gnu.org>2017-06-04 14:07:16 +1000
commit616b89734330a6406063ec3da6d380ac5d44640a (patch)
treedcbf0379e9a15c5429538fe98140d36d42ef42bc
parent886c747c8ecf4b2ec1adaf6ece5022a09adf6715 (diff)
downloaddejagnu-616b89734330a6406063ec3da6d380ac5d44640a.zip
dejagnu-616b89734330a6406063ec3da6d380ac5d44640a.tar.gz
dejagnu-616b89734330a6406063ec3da6d380ac5d44640a.tar.bz2
* lib/target.exp (push_target): Remove unnecessary global command.
* testsuite/runtest.all/target.test: Overhaul tests.
-rw-r--r--ChangeLog5
-rw-r--r--lib/target.exp4
-rw-r--r--testsuite/runtest.all/target.test159
3 files changed, 10 insertions, 158 deletions
diff --git a/ChangeLog b/ChangeLog
index 5fb286f..5810741 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2017-06-04 Ben Elliston <bje@gnu.org>
+ * lib/target.exp (push_target): Remove unnecessary global command.
+ * testsuite/runtest.all/target.test: Overhaul tests.
+
+2017-06-04 Ben Elliston <bje@gnu.org>
+
* testsuite/runtest.all/remote.test: Remove cruft from yesteryear.
2017-06-04 Tom de Vries <tom@codesourcery.com>
diff --git a/lib/target.exp b/lib/target.exp
index 4bff1dd..67655e6 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -57,9 +57,7 @@ set text "\[- A-Za-z0-9\.\;\"\_\:\'\`\(\)\!\#\=\+\?\&\*]"
# Set the target connection.
#
proc push_target { name } {
- global target_abbrev
-
- pop_config target
+ pop_config target
push_config target $name
}
diff --git a/testsuite/runtest.all/target.test b/testsuite/runtest.all/target.test
index b249e71..74ccd71 100644
--- a/testsuite/runtest.all/target.test
+++ b/testsuite/runtest.all/target.test
@@ -62,42 +62,9 @@ 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 push_config target
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"
@@ -105,70 +72,14 @@ if { $matches == 9 } {
# 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 } {
+if { ![info exists target_info(target,name)] } {
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"
@@ -176,70 +87,8 @@ if { $matches == 9 } {
# 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"
+if { ![info exists target_info(host,name)] } {
+ 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