From 0af97b5bdbdc4f3e8d29e8417bea9c6e45a79317 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 14 Jan 2022 12:18:45 +1100 Subject: [PATCH] Tools: test_build_options.py: test disabling all options --- Tools/autotest/test_build_options.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Tools/autotest/test_build_options.py b/Tools/autotest/test_build_options.py index 7418005878..b659e3ef77 100755 --- a/Tools/autotest/test_build_options.py +++ b/Tools/autotest/test_build_options.py @@ -54,6 +54,10 @@ def get_defines(feature, options): def test_feature(feature, options): defines = get_defines(feature, options) + test_compile_with_defines(defines) + + +def test_compile_with_defines(defines): extra_hwdef_filepath = "/tmp/extra.hwdef" write_defines_to_file(defines, extra_hwdef_filepath) util.waf_configure( @@ -64,12 +68,12 @@ def test_feature(feature, options): try: util.waf_build(t) except Exception: - print("Failed to build (%s) with (%s) disabled" % - (t, feature.label)) + print("Failed to build (%s) with everything disabled" % + (t,)) raise -def run(): +def run_disable_in_turn(): options = get_build_options_from_ardupilot_tree() count = 1 for feature in options: @@ -79,5 +83,18 @@ def run(): 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__': run()