diff --git a/Tools/autotest/test_build_options.py b/Tools/autotest/test_build_options.py index d6d5ff78165dc3..6dcfc61f22bebd 100755 --- a/Tools/autotest/test_build_options.py +++ b/Tools/autotest/test_build_options.py @@ -314,24 +314,23 @@ def define_is_whitelisted_for_feature_in_code(self, target, define): if target.lower() not in frozenset(["copter", "rover"]): feature_define_whitelist.add('HAL_SPRAYER_ENABLED') feature_define_whitelist.add('HAL_PROXIMITY_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_CYGBOT_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_DRONECAN_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_LIGHTWARE_SF40C_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_LIGHTWARE_SF45B_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_MAV_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_RANGEFINDER_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_RPLIDARA2_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_TERARANGERTOWER_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_TERARANGERTOWEREVO_ENABLED') + feature_define_whitelist.add('AP_PROXIMITY_.*_ENABLED') feature_define_whitelist.add('AP_OAPATHPLANNER_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_DODECAHEXA_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_DECA_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_HEXA_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_OCTA_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_QUAD_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_OCTAQUAD_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_Y6_ENABLED') - return define in feature_define_whitelist + feature_define_whitelist.add('AP_MOTORS_FRAME_.*_ENABLED') + + if target.lower() in ["blimp", "antennatracker"]: + # no airspeed on blimp/tracker + feature_define_whitelist.add(r'AP_AIRSPEED_.*_ENABLED') + + if target.lower() in ["blimp", "antennatracker", "sub"]: + # no OSD on Sub/blimp/tracker + feature_define_whitelist.add(r'OSD_ENABLED') + # camera instantiated in specific vehicles: + feature_define_whitelist.add(r'AP_CAMERA_ENABLED') + + for some_re in feature_define_whitelist: + if re.match(some_re, define): + return True def assert_feature_in_code(self, defines, feature): # if the feature is truly disabled then extract_features.py