sanitycheck: add west-runner parameter
Several boards have multiple runners setup. We need a way to specify
which runner to use with sanitycheck. Introduce --west-runner option.
Signed-off-by: Michael Scott <mike@foundries.io>
diff --git a/scripts/sanitycheck b/scripts/sanitycheck
index 4869714..32f6bad 100755
--- a/scripts/sanitycheck
+++ b/scripts/sanitycheck
@@ -676,6 +676,9 @@
if options.west_flash is not None:
command = ["west", "flash", "--skip-rebuild", "-d", self.outdir]
+ if options.west_runner is not None:
+ command.append("--runner")
+ command.append(options.west_runner)
# There are two ways this option is used.
# 1) bare: --west-flash
# This results in options.west_flash == []
@@ -3015,6 +3018,7 @@
which will ultimately disable ccache.
"""
)
+
parser.add_argument(
"--west-flash", nargs='?', const=[],
help="""Uses west instead of ninja or make to flash when running with
@@ -3027,6 +3031,18 @@
west flash -- --board-id=foobar
"""
)
+ parser.add_argument(
+ "--west-runner",
+ help="""Uses the specified west runner instead of default when running
+ with --west-flash.
+
+ E.g "sanitycheck --device-testing --device-serial /dev/ttyACM0
+ --west-flash --west-runner=pyocd"
+ will translate to "west flash --runner pyocd"
+
+ NOTE: west-flash must be enabled to use this option.
+ """
+ )
parser.add_argument("--gcov-tool", default=None,
help="Path to the gcov tool to use for code coverage "
@@ -3264,6 +3280,10 @@
resource.setrlimit(resource.RLIMIT_NOFILE, (4096, 4096))
options = parse_arguments()
+ if options.west_runner and not options.west_flash:
+ error("west-runner requires west-flash to be enabled")
+ sys.exit(1)
+
if options.coverage:
options.enable_coverage = True
options.enable_slow = True