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' % (mcu, toolchain)
descriptions.sort() message += '\n'.join([" [%2d] %s " % d for d in descriptions]) 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 not test.is_supported(mcu, toolchain): print 'The selected test is not supported on target %s with toolchain %s' % (mcu, toolchain) sys.exit() # RTOS if options.rtos: test.dependencies.append(RTOS_LIBRARIES) build_dir = join(BUILD_DIR, "test", mcu, toolchain, test.id) target = TARGET_MAP[mcu] try: bin = build_project(test.source_dir, build_dir, target, toolchain, test.dependencies, clean=options.clean, verbose=options.verbose) print 'Image: %s' % bin
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
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' % (
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 not test.is_supported(mcu, toolchain): print 'The selected test is not supported on target %s with toolchain %s' % ( mcu, toolchain) sys.exit() # RTOS if options.rtos: test.dependencies.append(RTOS_LIBRARIES) build_dir = join(BUILD_DIR, "test", mcu, toolchain, test.id) target = TARGET_MAP[mcu] try: bin = build_project(test.source_dir, build_dir,
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)
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.rtos: test.dependencies.append(RTOS_LIBRARIES) if options.eth: test.dependencies.append(ETH_LIBRARY) if options.usb_host: test.dependencies.append(USB_HOST_LIBRARIES)
else: n = alias else: args_error(parser, "[ERROR] Program with name '%s' not found" % n) p = TEST_MAP[n].n if p is None or (p < 0) or (p > (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) # Project if p is None or (p < 0) or (p > (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(p) # Some libraries have extra macros (called by exporter symbols) to we need to pass # them to maintain compilation macros integrity between compiled library and # header files we might use with it lib_symbols = [] for lib in LIBRARIES: if lib['build_dir'] in test.dependencies: lib_macros = lib.get('macros', None) if lib_macros is not None: lib_symbols.extend(lib_macros) 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: