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

Mike Frysinger via Gdb-patches
2021-04-04T14:35:49Z

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(+)

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]
--
2.30.2