mirror of https://github.com/ArduPilot/ardupilot
Tools: autotest: add extra-configure-args option to autotest.py
This commit is contained in:
parent
c8f726151b
commit
55377b424e
|
@ -307,6 +307,7 @@ def run_step(step):
|
|||
"debug": opts.debug,
|
||||
"clean": not opts.no_clean,
|
||||
"configure": not opts.no_configure,
|
||||
"extra_configure_args": opts.waf_configure_args,
|
||||
}
|
||||
|
||||
vehicle_binary = None
|
||||
|
@ -626,6 +627,12 @@ if __name__ == "__main__":
|
|||
action='store_true',
|
||||
help='do not configure before building',
|
||||
dest="no_configure")
|
||||
group_build.add_option("", "--waf-configure-args",
|
||||
action="append",
|
||||
dest="waf_configure_args",
|
||||
type="string",
|
||||
default=[],
|
||||
help="extra arguments passed to waf in configure")
|
||||
group_build.add_option("-j", default=None, type='int', help='build CPUs')
|
||||
group_build.add_option("--no-clean",
|
||||
default=False,
|
||||
|
|
|
@ -5,6 +5,7 @@ import math
|
|||
import os
|
||||
import random
|
||||
import re
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
@ -91,12 +92,15 @@ def relwaf():
|
|||
return "./modules/waf/waf-light"
|
||||
|
||||
|
||||
def waf_configure(board, j=None, debug=False):
|
||||
def waf_configure(board, j=None, debug=False, extra_args=[]):
|
||||
cmd_configure = [relwaf(), "configure", "--board", board]
|
||||
if debug:
|
||||
cmd_configure.append('--debug')
|
||||
if j is not None:
|
||||
cmd_configure.extend(['-j', str(j)])
|
||||
pieces = [shlex.split(x) for x in extra_args]
|
||||
for piece in pieces:
|
||||
cmd_configure.extend(piece)
|
||||
run_cmd(cmd_configure, directory=topdir(), checkfail=True)
|
||||
|
||||
|
||||
|
@ -104,12 +108,12 @@ def waf_clean():
|
|||
run_cmd([relwaf(), "clean"], directory=topdir(), checkfail=True)
|
||||
|
||||
|
||||
def build_SITL(build_target, j=None, debug=False, board='sitl', clean=True, configure=True):
|
||||
def build_SITL(build_target, j=None, debug=False, board='sitl', clean=True, configure=True, extra_configure_args=[]):
|
||||
"""Build desktop SITL."""
|
||||
|
||||
# first configure
|
||||
if configure:
|
||||
waf_configure(board, j=j, debug=debug)
|
||||
waf_configure(board, j=j, debug=debug, extra_args=extra_configure_args)
|
||||
|
||||
# then clean
|
||||
if clean:
|
||||
|
|
Loading…
Reference in New Issue