This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 05/14] gdb/testsuite: Skip a few gdb.base/skip.exp tests for remote targets
- From: Shahab Vahedi <shahab dot vahedi at gmail dot com>
- To: gdb-patches at sourceware dot org
- Cc: Shahab Vahedi <shahab at synopsys dot com>, Shahab Vahedi <shahab dot vahedi at gmail dot com>, Francois Bedard <fbedard at synopsys dot com>, Anton Kolesov <Anton dot Kolesov at synopsys dot com>
- Date: Fri, 7 Feb 2020 15:59:54 +0100
- Subject: [PATCH 05/14] gdb/testsuite: Skip a few gdb.base/skip.exp tests for remote targets
- References: <20200207150003.8383-1-shahab.vahedi@gmail.com>
From: Anton Kolesov <Anton.Kolesov@synopsys.com>
Few initial tests in gdb.base/skip.exp expect GDB to be in the state where
there is no default file for "skip" command. This is true when debugging
native targets - there is no inferior until "run" command is executed and
thus there is no "default" skip file. However that is not true for remote
targets - after "prepare_for_testing" test procedure GDB is already
connected to the target and has an existing inferior, so "default" file is
set by that time.
gdb/testsuite/ChangeLog:
2016-07-13 Anton Kolesov <Anton.Kolesov@synopsys.com>
* gdb.base/skip.exp: Skip a few tests if remotely connected.
Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
---
gdb/testsuite/gdb.base/skip.exp | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp
index 513c9fcc82ea..31a20c868a2a 100644
--- a/gdb/testsuite/gdb.base/skip.exp
+++ b/gdb/testsuite/gdb.base/skip.exp
@@ -30,10 +30,14 @@ set srcfile skip.c
set srcfile1 skip1.c
# Right after we start gdb, there's no default file or function to skip.
-
-gdb_test "skip file" "No default file now." "skip file (no default file)"
-gdb_test "skip function" "No default function now."
-gdb_test "skip" "No default function now." "skip (no default function)"
+# However that is not true for remote targets - after "prepare_for_testing" GDB
+# is already connected to the target and has a valid inferior, hence default
+# file.
+if ![use_gdb_stub] {
+ gdb_test "skip file" "No default file now." "skip file (no default file)"
+ gdb_test "skip function" "No default function now."
+ gdb_test "skip" "No default function now." "skip (no default function)"
+}
# Test elided args.
--
2.25.0