[2/3] sim: testsuite: skip tests when the port is disabled

Message ID 20210404143538.14995-2-vapier@gentoo.org
State New
Headers show
Series
  • [1/3] sim: testsuite: calculate $arch from $subdir
Related show

Commit Message

Simon Marchi via Gdb-patches April 4, 2021, 2:35 p.m.
If the port hasn't been enabled, don't try to run its tests.  Making
this dynamic simplifies the test harnesses and avoids duplicating a
bunch of target tuple checks.
---
 sim/testsuite/lib/sim-defs.exp | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.30.2

Patch

diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 1b40216ea6ed..e627b6efc595 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -205,6 +205,11 @@  proc run_sim_test { name requested_machs } {
     global global_cc_options
     global global_sim_options
 
+    if ![file exists [sim_tool_path]] {
+	unsupported "$name: missing simulator [sim_tool_path]"
+	return
+    }
+
     if [string match "*/*" $name] {
 	set file $name
 	set name [file tail $name]