mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
Tools: test_build_options.py: test disabling all options
This commit is contained in:
parent
a6099acd5c
commit
0af97b5bdb
@ -54,6 +54,10 @@ def get_defines(feature, options):
|
|||||||
|
|
||||||
def test_feature(feature, options):
|
def test_feature(feature, options):
|
||||||
defines = get_defines(feature, options)
|
defines = get_defines(feature, options)
|
||||||
|
test_compile_with_defines(defines)
|
||||||
|
|
||||||
|
|
||||||
|
def test_compile_with_defines(defines):
|
||||||
extra_hwdef_filepath = "/tmp/extra.hwdef"
|
extra_hwdef_filepath = "/tmp/extra.hwdef"
|
||||||
write_defines_to_file(defines, extra_hwdef_filepath)
|
write_defines_to_file(defines, extra_hwdef_filepath)
|
||||||
util.waf_configure(
|
util.waf_configure(
|
||||||
@ -64,12 +68,12 @@ def test_feature(feature, options):
|
|||||||
try:
|
try:
|
||||||
util.waf_build(t)
|
util.waf_build(t)
|
||||||
except Exception:
|
except Exception:
|
||||||
print("Failed to build (%s) with (%s) disabled" %
|
print("Failed to build (%s) with everything disabled" %
|
||||||
(t, feature.label))
|
(t,))
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run_disable_in_turn():
|
||||||
options = get_build_options_from_ardupilot_tree()
|
options = get_build_options_from_ardupilot_tree()
|
||||||
count = 1
|
count = 1
|
||||||
for feature in options:
|
for feature in options:
|
||||||
@ -79,5 +83,18 @@ def run():
|
|||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
|
|
||||||
|
def run_disable_all():
|
||||||
|
options = get_build_options_from_ardupilot_tree()
|
||||||
|
defines = {}
|
||||||
|
for feature in options:
|
||||||
|
defines[feature.define] = 0
|
||||||
|
test_compile_with_defines(defines)
|
||||||
|
|
||||||
|
|
||||||
|
def run():
|
||||||
|
run_disable_all()
|
||||||
|
run_disable_in_turn()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
run()
|
run()
|
||||||
|
Loading…
Reference in New Issue
Block a user