diff options
author | Pedro Alves <palves@redhat.com> | 2015-01-09 11:04:19 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-01-09 11:04:19 +0000 |
commit | 60b3033e6e2936af6fcc37cf67cade99a89940ad (patch) | |
tree | 17c1b5534cd962559787f43ac2ee19e8f12a11d2 /gdb/testsuite/gdb.python | |
parent | 1710aab8af63e37c846efb7ed66e76dce95330ba (diff) | |
download | binutils-60b3033e6e2936af6fcc37cf67cade99a89940ad.zip binutils-60b3033e6e2936af6fcc37cf67cade99a89940ad.tar.gz binutils-60b3033e6e2936af6fcc37cf67cade99a89940ad.tar.bz2 |
skip "attach" tests when testing against stub-like targets
We already skip "attach" tests if the target board is remote, in
dejagnu's sense, as we use TCL's exec to spawn the program on the
build machine. We should also skip these tests if testing with
"target remote" or other stub-like targets where "attach" doesn't make
sense.
Add a helper procedure that centralizes the checks a test that needs
to spawn a program for testing "attach" and make all test files that
use spawn_wait_for_attach check it.
gdb/testsuite/
2015-01-09 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (can_spawn_for_attach): New procedure.
(spawn_wait_for_attach): Error out if can_spawn_for_attach returns
false.
* gdb.base/attach.exp: Use can_spawn_for_attach instead of
checking whether the target board is remote.
* gdb.multi/multi-attach.exp: Likewise.
* gdb.python/py-sync-interp.exp: Likewise.
* gdb.server/ext-attach.exp: Likewise.
* gdb.python/py-prompt.exp: Use can_spawn_for_attach before the
tests that need to attach, instead of checking whether the target
board is remote at the top of the file.
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r-- | gdb/testsuite/gdb.python/py-prompt.exp | 9 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-sync-interp.exp | 3 |
2 files changed, 5 insertions, 7 deletions
diff --git a/gdb/testsuite/gdb.python/py-prompt.exp b/gdb/testsuite/gdb.python/py-prompt.exp index 28f5e9a..55f0f59 100644 --- a/gdb/testsuite/gdb.python/py-prompt.exp +++ b/gdb/testsuite/gdb.python/py-prompt.exp @@ -18,11 +18,6 @@ standard_testfile -# We need to use TCL's exec to get the pid. -if [is_remote target] then { - return 0 -} - load_lib gdb-python.exp load_lib prompt.exp @@ -80,6 +75,10 @@ gdb_test "python print (\"'\" + str(p\[0\]) + \"'\")" "'$gdb_prompt_fail '" \ "prompt_hook argument is default prompt. 2" gdb_exit +if {![can_spawn_for_attach]} { + return 0 +} + set testpid [spawn_wait_for_attach $binfile] set GDBFLAGS [concat $tmp_gdbflags " -ex \"set pagination off\""] diff --git a/gdb/testsuite/gdb.python/py-sync-interp.exp b/gdb/testsuite/gdb.python/py-sync-interp.exp index 595db3d..0ea3110 100644 --- a/gdb/testsuite/gdb.python/py-sync-interp.exp +++ b/gdb/testsuite/gdb.python/py-sync-interp.exp @@ -20,8 +20,7 @@ standard_testfile -# We need to use TCL's exec to get the pid. -if [is_remote target] then { +if {![can_spawn_for_attach]} { return 0 } |