public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: cris: fix testsuite hang when sim is missing
@ 2021-11-27  0:38 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-11-27  0:38 UTC (permalink / raw)
  To: gdb-patches

If the cris sim hasn't been built yet, trying to run its testsuite
will hang indefinitely.  The common sim APIs already have this, so
copy it over to the cris forks of the test+run functions.
---
 sim/testsuite/cris/c/c.exp              | 5 +++++
 sim/testsuite/cris/hw/rv-n-cris/rvc.exp | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/sim/testsuite/cris/c/c.exp b/sim/testsuite/cris/c/c.exp
index bd51d73432fb..25d812ea7356 100644
--- a/sim/testsuite/cris/c/c.exp
+++ b/sim/testsuite/cris/c/c.exp
@@ -94,6 +94,11 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
 	continue
     }
 
+    if ![file exists [sim_tool_path]] {
+	untested $testname
+	return 0
+    }
+
     # Clear default options
     set opts(cc) ""
     set opts(sim) ""
diff --git a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
index 42de37d896cd..847d906d497f 100644
--- a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
+++ b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
@@ -24,6 +24,10 @@ proc sim_has_rv_and_cris {} {
     global objdir
     global SIMFLAGS_FOR_TARGET
 
+    if ![file exists [sim_tool_path]] {
+	return 0
+    }
+
     # We need to assemble and link a trivial program and pass that, in
     # order to test successful exit.
 
-- 
2.33.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-27  0:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27  0:38 [PATCH] sim: cris: fix testsuite hang when sim is missing Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).