mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Pass app config to get config
This corrects a bug which would manifest as --app-config not having much of an affect on test builds (not the first libary bulid)pull/6793/head
							parent
							
								
									4e66f218fd
								
							
						
					
					
						commit
						0f7e900417
					
				| 
						 | 
				
			
			@ -120,7 +120,7 @@ def add_result_to_report(report, result):
 | 
			
		|||
    result_wrap = {0: result}
 | 
			
		||||
    report[target][toolchain][id_name].append(result_wrap)
 | 
			
		||||
 | 
			
		||||
def get_config(src_paths, target, toolchain_name):
 | 
			
		||||
def get_config(src_paths, target, toolchain_name, app_config=None):
 | 
			
		||||
    """Get the configuration object for a target-toolchain combination
 | 
			
		||||
 | 
			
		||||
    Positional arguments:
 | 
			
		||||
| 
						 | 
				
			
			@ -133,7 +133,8 @@ def get_config(src_paths, target, toolchain_name):
 | 
			
		|||
        src_paths = [src_paths]
 | 
			
		||||
 | 
			
		||||
    # Pass all params to the unified prepare_resources()
 | 
			
		||||
    toolchain = prepare_toolchain(src_paths, None, target, toolchain_name)
 | 
			
		||||
    toolchain = prepare_toolchain(src_paths, None, target, toolchain_name,
 | 
			
		||||
                                  app_config=app_config)
 | 
			
		||||
 | 
			
		||||
    # Scan src_path for config files
 | 
			
		||||
    resources = toolchain.scan_resources(src_paths[0])
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,7 +33,8 @@ from tools.utils import argparse_filestring_type
 | 
			
		|||
 | 
			
		||||
if __name__ == '__main__':
 | 
			
		||||
    # Parse Options
 | 
			
		||||
    parser = get_default_options_parser(add_clean=False, add_options=False)
 | 
			
		||||
    parser = get_default_options_parser(add_clean=False, add_options=False,
 | 
			
		||||
                                        add_app_config=True)
 | 
			
		||||
    parser.add_argument(
 | 
			
		||||
        "--source", dest="source_dir", type=argparse_filestring_type,
 | 
			
		||||
        required=True, default=[], help="The source (input) directory",
 | 
			
		||||
| 
						 | 
				
			
			@ -61,7 +62,7 @@ if __name__ == '__main__':
 | 
			
		|||
 | 
			
		||||
    try:
 | 
			
		||||
        params, macros, features = get_config(
 | 
			
		||||
            options.source_dir, target, toolchain)
 | 
			
		||||
            options.source_dir, target, toolchain, app_config=options.app_config)
 | 
			
		||||
        if not params and not macros:
 | 
			
		||||
            print("No configuration data available.")
 | 
			
		||||
            sys.exit(0)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2220,7 +2220,7 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
 | 
			
		|||
    base_path = norm_relative_path(build_path, execution_directory)
 | 
			
		||||
 | 
			
		||||
    target_name = target.name if isinstance(target, Target) else target
 | 
			
		||||
    cfg, _, _ = get_config(base_source_paths, target_name, toolchain_name)
 | 
			
		||||
    cfg, _, _ = get_config(base_source_paths, target_name, toolchain_name, app_config=app_config)
 | 
			
		||||
 | 
			
		||||
    baud_rate = 9600
 | 
			
		||||
    if 'platform.stdio-baud-rate' in cfg:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue