Tools: autotest: add extra-configure-args option to autotest.py

This commit is contained in:
Peter Barker 2018-10-01 09:04:57 +10:00
parent c8f726151b
commit 55377b424e
2 changed files with 14 additions and 3 deletions

View File

@ -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,

View File

@ -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: