diff mbox

[14/14] gdb/testsuite: Skip some compile.exp tests when running with gdb-comm board

Message ID 20200207150003.8383-15-shahab.vahedi@gmail.com
State New
Headers show

Commit Message

Shahab Vahedi Feb. 7, 2020, 3 p.m. UTC
From: Anton Kolesov <Anton.Kolesov@synopsys.com>

gdb/testsuite/ChangeLog:
2016-08-19  Anton Kolesov <Anton.Kolesov@synopsys.com>

	* gdb.compile/compile.exp: Skip if "gdb_comm" was used.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
---
 gdb/testsuite/gdb.compile/compile.exp | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
diff mbox

Patch

diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp
index 9ad4181b2fe8..eb4f9bae11dd 100644
--- a/gdb/testsuite/gdb.compile/compile.exp
+++ b/gdb/testsuite/gdb.compile/compile.exp
@@ -40,17 +40,20 @@  clean_restart ${testfile}
 #
 # Test command without an running inferior.
 #
-gdb_test "compile code int i=2;" \
-    "The program must be running for the compile command to work.*" \
-    "test compile code command without running inferior"
-
-gdb_test "compile int i=2;" \
-    "The program must be running for the compile command to work.*" \
-    "test compile command without running inferior"
-
-gdb_test "compile file -r ${srcdir}/${subdir}/${testfile}-mod.c" \
-    "The program must be running for the compile command to work.*" \
-    "test compile file command without running inferior"
+# If target is run via gdb_comm board, then there is already running inferior.
+if {[target_info protocol] != "gdb_comm"} {
+    gdb_test "compile code int i=2;" \
+	"The program must be running for the compile command to work.*" \
+	"test compile code command without running inferior"
+
+    gdb_test "compile int i=2;" \
+	"The program must be running for the compile command to work.*" \
+	"test compile command without running inferior"
+
+    gdb_test "compile file -r ${srcdir}/${subdir}/${testfile}-mod.c" \
+	"The program must be running for the compile command to work.*" \
+	"test compile file command without running inferior"
+}
 
 if ![runto_main] {
     return -1