message = "[ERROR] You have to specify one of the following tests:\n" message += '\n'.join(map(str, sorted(TEST_MAP.values()))) args_error(parser, message) # Target if options.mcu is None: args_error(parser, "[ERROR] You should specify an MCU") mcu = options.mcu # Toolchain if options.tool is None: args_error(parser, "[ERROR] You should specify a TOOLCHAIN") toolchain = options.tool # Test test = Test(p) if options.automated is not None: test.automated = options.automated if options.dependencies is not None: test.dependencies = options.dependencies if options.host_test is not None: test.host_test = options.host_test if options.peripherals is not None: test.peripherals = options.peripherals if options.duration is not None: test.duration = options.duration if options.extra is not None: test.extra_files = options.extra if not test.is_supported(mcu, toolchain): print 'The selected test is not supported on target %s with toolchain %s' % (
if type(p) != type([]): p = [p] # Target if options.mcu is None: args_error(parser, "[ERROR] You should specify an MCU") mcu = options.mcu # Toolchain if options.tool is None: args_error(parser, "[ERROR] You should specify a TOOLCHAIN") toolchain = options.tool # Test for test_no in p: test = Test(test_no) if options.automated is not None: test.automated = options.automated if options.dependencies is not None: test.dependencies = options.dependencies if options.host_test is not None: test.host_test = options.host_test if options.peripherals is not None: test.peripherals = options.peripherals if options.duration is not None: test.duration = options.duration if options.extra is not None: test.extra_files = options.extra if not test.is_supported(mcu, toolchain): print 'The selected test is not supported on target %s with toolchain %s' % ( mcu, toolchain) sys.exit() # Linking with extra libraries
if options.mcu is None: args_error(parser, "[ERROR] You should specify an MCU") mcu = options.mcu # IDE if options.ide is None: args_error(parser, "[ERROR] You should specify an IDE") ide = options.ide # Project if options.program is None or (options.program < 0) or (options.program > (len(TESTS) - 1)): message = "[ERROR] You have to specify one of the following tests:\n" message += '\n'.join(map(str, sorted(TEST_MAP.values()))) args_error(parser, message) test = Test(options.program) if not options.build: # Substitute the library builds with the sources # TODO: Substitute also the other library build paths if MBED_LIBRARIES in test.dependencies: test.dependencies.remove(MBED_LIBRARIES) test.dependencies.append(MBED_BASE) # Build the projectwith the same directory structure of the mbed online IDE project_dir = join(EXPORT_WORKSPACE, test.id) setup_user_prj(project_dir, test.source_dir, test.dependencies) # Export to selected toolchain tmp_path, report = export(project_dir, test.id, ide, mcu, EXPORT_WORKSPACE, EXPORT_TMP)