mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 09:58:28 -04:00
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,
|
"debug": opts.debug,
|
||||||
"clean": not opts.no_clean,
|
"clean": not opts.no_clean,
|
||||||
"configure": not opts.no_configure,
|
"configure": not opts.no_configure,
|
||||||
|
"extra_configure_args": opts.waf_configure_args,
|
||||||
}
|
}
|
||||||
|
|
||||||
vehicle_binary = None
|
vehicle_binary = None
|
||||||
@ -626,6 +627,12 @@ if __name__ == "__main__":
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
help='do not configure before building',
|
help='do not configure before building',
|
||||||
dest="no_configure")
|
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("-j", default=None, type='int', help='build CPUs')
|
||||||
group_build.add_option("--no-clean",
|
group_build.add_option("--no-clean",
|
||||||
default=False,
|
default=False,
|
||||||
|
@ -5,6 +5,7 @@ import math
|
|||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import re
|
import re
|
||||||
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
@ -91,12 +92,15 @@ def relwaf():
|
|||||||
return "./modules/waf/waf-light"
|
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]
|
cmd_configure = [relwaf(), "configure", "--board", board]
|
||||||
if debug:
|
if debug:
|
||||||
cmd_configure.append('--debug')
|
cmd_configure.append('--debug')
|
||||||
if j is not None:
|
if j is not None:
|
||||||
cmd_configure.extend(['-j', str(j)])
|
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)
|
run_cmd(cmd_configure, directory=topdir(), checkfail=True)
|
||||||
|
|
||||||
|
|
||||||
@ -104,12 +108,12 @@ def waf_clean():
|
|||||||
run_cmd([relwaf(), "clean"], directory=topdir(), checkfail=True)
|
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."""
|
"""Build desktop SITL."""
|
||||||
|
|
||||||
# first configure
|
# first configure
|
||||||
if configure:
|
if configure:
|
||||||
waf_configure(board, j=j, debug=debug)
|
waf_configure(board, j=j, debug=debug, extra_args=extra_configure_args)
|
||||||
|
|
||||||
# then clean
|
# then clean
|
||||||
if clean:
|
if clean:
|
||||||
|
Loading…
Reference in New Issue
Block a user