sim: testsuite: skip tests when the port is disabled
authorMike Frysinger <vapier@gentoo.org>
Sun, 4 Apr 2021 13:05:21 +0000 (09:05 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 8 Apr 2021 04:47:49 +0000 (00:47 -0400)
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/ChangeLog
sim/testsuite/lib/sim-defs.exp

index 8876c386aeb856687f850fdace3aae5f2d0680d7..113b6d5622c90517b784c2366b7ed0ce74afde83 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-08  Mike Frysinger  <vapier@gentoo.org>
+
+       * lib/sim-defs.exp (run_sim_test): Return if sim_tool_path does not
+       exist.
+
 2021-04-08  Mike Frysinger  <vapier@gentoo.org>
 
        * lib/sim-defs.exp (sim_tool_path): New function.
index 1b40216ea6ed632b25750c2fff1131edd8e7fdfc..e627b6efc595f92747f4bc7e66b29df3667c9584 100644 (file)
@@ -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]