Skip to content
Permalink
Browse files

sanitycheck: handle west-flash dependency for device-testing

sanitycheck --help mentions that west-flash requires device-testing
to be enabled (and indeed it does because DeviceHandler will never
be called where west_flash option is used.  Let's generate an error
if west-flash is used w/o specifying device-testing.

Also cleanup help text which looks odd in both sanitycheck --help
and in the file itself.

Signed-off-by: Michael Scott <mike@foundries.io>
  • Loading branch information...
mike-scott authored and nashif committed Jul 9, 2019
1 parent 421ce46 commit 4ca54390f4c383844124aa37cd84d96c5789d1b4
Showing with 10 additions and 6 deletions.
  1. +10 −6 scripts/sanitycheck
@@ -3022,13 +3022,13 @@ Artificially long but functional example:
parser.add_argument(
"--west-flash", nargs='?', const=[],
help="""Uses west instead of ninja or make to flash when running with
--device-testing"
--device-testing.
E.g
sanitycheck --device-testing --device-serial /dev/ttyACM0 \
--west-flash="--board-id=foobar"
will translate to
west flash -- --board-id=foobar
E.g "sanitycheck --device-testing --device-serial /dev/ttyACM0
--west-flash="--board-id=foobar"
will translate to "west flash -- --board-id=foobar"
NOTE: device-testing must be enabled to use this option.
"""
)
parser.add_argument(
@@ -3284,6 +3284,10 @@ def main():
error("west-runner requires west-flash to be enabled")
sys.exit(1)

if options.west_flash and not options.device_testing:
error("west-flash requires device-testing to be enabled")
sys.exit(1)

if options.coverage:
options.enable_coverage = True
options.enable_slow = True

0 comments on commit 4ca5439

Please sign in to comment.
You can’t perform that action at this time.