def benchmarks(): # CSV Data csv_data = csv.writer(open(BENCHMARK_DATA_PATH, 'wb')) csv_data.writerow(['Toolchain', "Target", "Benchmark", "code", "data", "bss", "flash"]) # Build for toolchain in ['ARM', 'uARM', 'GCC_CR', 'GCC_CS', 'GCC_ARM']: for mcu in ["LPC1768", "LPC11U24"]: # Build Libraries build_mbed_libs(mcu, toolchain) # Build benchmarks build_dir = join(BUILD_DIR, "benchmarks", mcu, toolchain) for test_id, title in BENCHMARKS: # Build Benchmark try: test = TEST_MAP[test_id] path = build_project(test.source_dir, join(build_dir, test_id), mcu, toolchain, test.dependencies) base, ext = splitext(path) # Check Size code, data, bss, flash = get_size(base+'.elf') csv_data.writerow([toolchain, mcu, title, code, data, bss, flash]) except Exception, e: print "Unable to build %s for toolchain %s targeting %s" % (test_id, toolchain, mcu) print e
def benchmarks(): # CSV Data csv_data = csv.writer(open(BENCHMARK_DATA_PATH, 'wb')) csv_data.writerow( ['Toolchain', "Target", "Benchmark", "code", "data", "bss", "flash"]) # Build for toolchain in ['ARM', 'uARM', 'GCC_CR', 'GCC_ARM']: for mcu in ["LPC1768", "LPC11U24"]: # Build Libraries build_mbed_libs(mcu, toolchain) # Build benchmarks build_dir = join(BUILD_DIR, "benchmarks", mcu, toolchain) for test_id, title in BENCHMARKS: # Build Benchmark try: test = TEST_MAP[test_id] path = build_project(test.source_dir, join(build_dir, test_id), mcu, toolchain, test.dependencies) base, ext = splitext(path) # Check Size code, data, bss, flash = get_size(base + '.elf') csv_data.writerow( [toolchain, mcu, title, code, data, bss, flash]) except Exception, e: print "Unable to build %s for toolchain %s targeting %s" % ( test_id, toolchain, mcu) print e
if options.dsp: libraries.extend(["cmsis_dsp", "dsp"]) if options.ublox: libraries.extend(["rtx", "rtos", "usb_host", "ublox"]) # Build failures = [] successes = [] for toolchain in toolchains: for target in targets: id = "%s::%s" % (toolchain, target) try: mcu = TARGET_MAP[target] build_mbed_libs(mcu, toolchain, options=options.options, verbose=options.verbose, clean=options.clean, macros=options.macros) for lib_id in libraries: build_lib(lib_id, mcu, toolchain, options=options.options, verbose=options.verbose, clean=options.clean, macros=options.macros) successes.append(id) except Exception, e: if options.verbose: import sys, traceback traceback.print_exc(file=sys.stdout)
# Test Results tests_results = [] test_time = datetime.datetime.utcnow() test_report = { "date": test_time.isoformat(), "test_server": SERVER_ADDRESS, "test_results": tests_results } successes = [] failures = [] for target, toolchains in test_spec['targets'].iteritems(): for toolchain in toolchains: print '=== %s::%s ===' % (target, toolchain) build_mbed_libs(target, toolchain) build_dir = join(BUILD_DIR, "test", target, toolchain) for test_id, test in TEST_MAP.iteritems(): if test_ids is not None and test_id not in test_ids: continue if test.automated and test.is_supported(target, toolchain): # Check if the server has the capability to serve our test request if not test_server.available(target, test.peripherals): print "The test server does not have such device: %s, %s" % (target, test.peripherals) continue test_result = { 'target': target,
help="Build using only the official toolchain for each target") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="Verbose diagnostic output") options, args = parser.parse_args() start = time() failures = [] successes = [] for target_name, toolchain_list in OFFICIAL_MBED_LIBRARY_BUILD: if options.official_only: toolchains = (getattr(TARGET_MAP[target_name], 'ONLINE_TOOLCHAIN', 'ARM'),) else: toolchains = toolchain_list for toolchain in toolchains: id = "%s::%s" % (target_name, toolchain) try: build_mbed_libs(TARGET_MAP[target_name], toolchain, verbose=options.verbose) successes.append(id) except Exception, e: failures.append(id) print e # Write summary of the builds print "\n\nCompleted in: (%.2f)s" % (time() - start) if successes: print "\n\nBuild successes:" print "\n".join([" * %s" % s for s in successes]) if failures: print "\n\nBuild failures:" print "\n".join([" * %s" % f for f in failures])
start = time() single_test = SingleTestRunner() clean = test_spec.get('clean', False) test_ids = test_spec.get('test_ids', []) groups = test_spec.get('test_groups', []) # Here we store test results test_summary = [] for target, toolchains in test_spec['targets'].iteritems(): for toolchain in toolchains: # print '=== %s::%s ===' % (target, toolchain) # Let's build our test T = TARGET_MAP[target] build_mbed_libs(T, toolchain) build_dir = join(BUILD_DIR, "test", target, toolchain) for test_id, test in TEST_MAP.iteritems(): if test_ids and test_id not in test_ids: continue if test.automated and test.is_supported(target, toolchain): if not is_peripherals_available(target, test.peripherals): if opts.verbose: print "TargetTest::%s::TestSkipped(%s)" % (target, ",".join(test.peripherals)) continue test_result = { 'target': target, 'toolchain': toolchain,
groups = test_spec.get('test_groups', []) # Here we store test results test_summary = [] for target, toolchains in test_spec['targets'].iteritems(): for toolchain in toolchains: # print '=== %s::%s ===' % (target, toolchain) # Let's build our test if target not in TARGET_MAP: print 'Skipped tests for %s target. Target platform not found' % (target) continue T = TARGET_MAP[target] build_mbed_libs_options = ["analyze"] if opts.goanna_for_mbed_sdk else None build_mbed_libs_result = build_mbed_libs(T, toolchain, options=build_mbed_libs_options) if not build_mbed_libs_result: print 'Skipped tests for %s target. Toolchain %s is not yet supported for this target' % (T.name, toolchain) continue build_dir = join(BUILD_DIR, "test", target, toolchain) for test_id, test in TEST_MAP.iteritems(): if opts.test_by_names and test_id not in opts.test_by_names.split(','): continue if test_ids and test_id not in test_ids: continue if opts.test_only_peripheral and not test.peripherals: if opts.verbose_skipped_tests:
if options.vodafone: libraries.append("vodafone") if options.usb: libraries.append("usb") if options.dsp: libraries.extend(["cmsis_dsp", "dsp"]) # Build failures = [] successes = [] for toolchain in toolchains: for target in targets: id = "%s::%s" % (toolchain, target) try: mcu = TARGET_MAP[target] build_mbed_libs(mcu, toolchain, verbose=options.verbose) for lib_id in libraries: build_lib(lib_id, mcu, toolchain, verbose=options.verbose) successes.append(id) except Exception, e: failures.append(id) print e # Write summary of the builds print "\n\nCompleted in: (%.2f)s" % (time() - start) if successes: print "\n\nBuild successes:" print "\n".join([" * %s" % s for s in successes]) if failures:
if options.toolchains: print "Only building using the following toolchains: %s" % ( options.toolchains) toolchainSet = set(toolchains) toolchains = toolchainSet.intersection( set((options.toolchains).split(','))) for toolchain in toolchains: id = "%s::%s" % (target_name, toolchain) try: built_mbed_lib = build_mbed_libs( TARGET_MAP[target_name], toolchain, verbose=options.verbose, jobs=options.jobs, report=build_report, properties=build_properties) except Exception, e: print str(e) # Write summary of the builds if options.report_build_file_name: file_report_exporter = ReportExporter(ResultExporterType.JUNIT, package="build") file_report_exporter.report_to_file( build_report, options.report_build_file_name, test_suite_properties=build_properties)
toolchains = (getattr(TARGET_MAP[target_name], 'default_toolchain', 'ARM'),) else: toolchains = toolchain_list if options.toolchains: print "Only building using the following toolchains: %s" % (options.toolchains) toolchainSet = set(toolchains) toolchains = toolchainSet and set((options.toolchains).split(',')) cur_target_build_report = { "target": target_name, "passing": [], "failing": [], "skipped": []} for toolchain in toolchains: id = "%s::%s" % (target_name, toolchain) try: built_mbed_lib = build_mbed_libs(TARGET_MAP[target_name], toolchain, verbose=options.verbose, jobs=options.jobs) if built_mbed_lib: successes.append(id) cur_target_build_report["passing"].append({ "toolchain": toolchain }) else: skips.append(id) cur_target_build_report["skipped"].append({ "toolchain": toolchain }) except Exception, e: failures.append(id) cur_target_build_report["failing"].append({ "toolchain": toolchain }) print e if len(toolchains) > 0:
tests_results = [] test_time = datetime.datetime.utcnow() test_report = { "date": test_time.isoformat(), "test_server": SERVER_ADDRESS, "test_results": tests_results } successes = [] failures = [] for target, toolchains in test_spec['targets'].iteritems(): for toolchain in toolchains: print '=== %s::%s ===' % (target, toolchain) T = TARGET_MAP[target] build_mbed_libs(T, toolchain) build_dir = join(BUILD_DIR, "test", target, toolchain) for test_id, test in TEST_MAP.iteritems(): if test_ids and test_id not in test_ids: continue if test.automated and test.is_supported(target, toolchain): # Check if the server has the capability to serve our test request if not test_server.available(target, test.peripherals): print "The test server does not have such device: %s, %s" % (target, test.peripherals) continue test_result = { 'target': target,
if options.usb: libraries.append("usb") if options.usb_host: libraries.append("usb_host") if options.dsp: libraries.extend(["cmsis_dsp", "dsp"]) # Build failures = [] successes = [] for toolchain in toolchains: for target in targets: id = "%s::%s" % (toolchain, target) try: mcu = TARGET_MAP[target] build_mbed_libs(mcu, toolchain, options=options.options, verbose=options.verbose, clean=options.clean) for lib_id in libraries: build_lib(lib_id, mcu, toolchain, options=options.options, verbose=options.verbose, clean=options.clean) successes.append(id) except Exception, e: if options.verbose: import sys, traceback traceback.print_exc(file=sys.stdout) sys.exit(1) failures.append(id) print e # Write summary of the builds print "\n\nCompleted in: (%.2f)s" % (time() - start)
if options.verbose: import traceback traceback.print_exc(file=sys.stdout) sys.exit(1) print e else: # Build for toolchain in toolchains: for target in targets: tt_id = "%s::%s" % (toolchain, target) try: mcu = TARGET_MAP[target] lib_build_res = build_mbed_libs(mcu, toolchain, options=options.options, extra_verbose=options.extra_verbose_notify, verbose=options.verbose, silent=options.silent, jobs=options.jobs, clean=options.clean, macros=options.macros) for lib_id in libraries: build_lib(lib_id, mcu, toolchain, options=options.options, extra_verbose=options.extra_verbose_notify, verbose=options.verbose, silent=options.silent, clean=options.clean, macros=options.macros, jobs=options.jobs) if lib_build_res: successes.append(tt_id) else:
# Here we store test results test_summary = [] for target, toolchains in test_spec['targets'].iteritems(): for toolchain in toolchains: # print '=== %s::%s ===' % (target, toolchain) # Let's build our test if target not in TARGET_MAP: print 'Skipped tests for %s target. Target platform not found' % ( target) continue T = TARGET_MAP[target] build_mbed_libs_options = ["analyze" ] if opts.goanna_for_mbed_sdk else None build_mbed_libs_result = build_mbed_libs( T, toolchain, options=build_mbed_libs_options) if not build_mbed_libs_result: print 'Skipped tests for %s target. Toolchain %s is not yet supported for this target' % ( T.name, toolchain) continue build_dir = join(BUILD_DIR, "test", target, toolchain) for test_id, test in TEST_MAP.iteritems(): if opts.test_by_names and test_id not in opts.test_by_names.split( ','): continue if test_ids and test_id not in test_ids: continue
libraries.append("eth") if options.vodafone: libraries.append("vodafone") if options.usb: libraries.append("usb") if options.dsp: libraries.extend(["cmsis_dsp", "dsp"]) # Build failures = [] successes = [] for toolchain in toolchains: for target in targets: id = "%s::%s" % (toolchain, target) try: build_mbed_libs(target, toolchain, verbose=options.verbose) for lib_id in libraries: build_lib(lib_id, target, toolchain, verbose=options.verbose) successes.append(id) except Exception, e: failures.append(id) print e # Write summary of the builds print "\n\nCompleted in: (%.2f)s" % (time() - start) if successes: print "\n\nBuild successes:"
libraries.append("eth") if options.vodafone: libraries.append("vodafone") if options.usb: libraries.append("usb") if options.dsp: libraries.extend(["cmsis_dsp", "dsp"]) # Build failures = [] successes = [] for toolchain in toolchains: for target in targets: id = "%s::%s" % (toolchain, target) try: build_mbed_libs(target, toolchain, verbose=options.verbose) for lib_id in libraries: build_lib(lib_id, target, toolchain, verbose=options.verbose) successes.append(id) except Exception, e: failures.append(id) print e # Write summary of the builds print "\n\nCompleted in: (%.2f)s" % (time() - start) if successes: print "\n\nBuild successes:" print "\n".join([" * %s" % s for s in successes]) if failures:
if options.dsp: libraries.extend(["cmsis_dsp", "dsp"]) if options.ublox: libraries.extend(["rtx", "rtos", "usb_host", "ublox"]) # Build failures = [] successes = [] for toolchain in toolchains: for target in targets: id = "%s::%s" % (toolchain, target) try: mcu = TARGET_MAP[target] notify = print_notify_verbose if options.extra_verbose_notify else None # Special notify for CI (more verbose) build_mbed_libs(mcu, toolchain, options=options.options, notify=notify, verbose=options.verbose, clean=options.clean, macros=options.macros) for lib_id in libraries: notify = print_notify_verbose if options.extra_verbose_notify else None # Special notify for CI (more verbose) build_lib(lib_id, mcu, toolchain, options=options.options, notify=notify, verbose=options.verbose, clean=options.clean, macros=options.macros) successes.append(id) except Exception, e: if options.verbose: import sys, traceback traceback.print_exc(file=sys.stdout) sys.exit(1) failures.append(id) print e
("NUCLEO_F401RE", ("ARM", "uARM")), ("NUCLEO_F030R8", ("ARM", "uARM")), ("NUCLEO_F302R8", ("ARM", "uARM")), ("NRF51822", ("ARM",)), ) if __name__ == "__main__": start = time() failures = [] successes = [] for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD: for toolchain in toolchains: id = "%s::%s" % (target_name, toolchain) try: build_mbed_libs(TARGET_MAP[target_name], toolchain) successes.append(id) except Exception, e: failures.append(id) print e # Write summary of the builds print "\n\nCompleted in: (%.2f)s" % (time() - start) if successes: print "\n\nBuild successes:" print "\n".join([" * %s" % s for s in successes]) if failures: print "\n\nBuild failures:" print "\n".join([" * %s" % f for f in failures])
# Test Results tests_results = [] test_time = datetime.datetime.utcnow() test_report = { "date": test_time.isoformat(), "test_server": SERVER_ADDRESS, "test_results": tests_results } successes = [] failures = [] for target, toolchains in test_spec['targets'].iteritems(): for toolchain in toolchains: print '=== %s::%s ===' % (target, toolchain) build_mbed_libs(target, toolchain) build_dir = join(BUILD_DIR, "test", target, toolchain) for test_id, test in TEST_MAP.iteritems(): if test_ids is not None and test_id not in test_ids: continue if test.automated and test.is_supported(target, toolchain): # Check if the server has the capability to serve our test request if not test_server.available(target, test.peripherals): print "The test server does not have such device: %s, %s" % ( target, test.peripherals) continue test_result = {
pass except Exception, e: if options.verbose: import traceback traceback.print_exc(file=sys.stdout) sys.exit(1) print e else: # Build for toolchain in toolchains: for target in targets: tt_id = "%s::%s" % (toolchain, target) try: mcu = TARGET_MAP[target] lib_build_res = build_mbed_libs(mcu, toolchain, options=options.options, notify=notify, verbose=options.verbose, jobs=options.jobs, clean=options.clean, macros=options.macros) for lib_id in libraries: notify = print_notify_verbose if options.extra_verbose_notify else None # Special notify for CI (more verbose) build_lib(lib_id, mcu, toolchain, options=options.options, notify=notify, verbose=options.verbose, clean=options.clean, macros=options.macros, jobs=options.jobs) if lib_build_res: successes.append(tt_id) else: skipped.append(tt_id) except Exception, e: if options.verbose: import traceback traceback.print_exc(file=sys.stdout) sys.exit(1)
help="Verbose diagnostic output") options, args = parser.parse_args() start = time() failures = [] successes = [] for target_name, toolchain_list in OFFICIAL_MBED_LIBRARY_BUILD: if options.official_only: toolchains = (getattr(TARGET_MAP[target_name], 'default_toolchain', 'ARM'), ) else: toolchains = toolchain_list for toolchain in toolchains: id = "%s::%s" % (target_name, toolchain) try: build_mbed_libs(TARGET_MAP[target_name], toolchain, verbose=options.verbose, jobs=options.jobs) successes.append(id) except Exception, e: failures.append(id) print e # Write summary of the builds print "\n\nCompleted in: (%.2f)s" % (time() - start) if successes: print "\n\nBuild successes:" print "\n".join([" * %s" % s for s in successes]) if failures: print "\n\nBuild failures:"
OFFICIAL_MBED_LIBRARY_BUILD = (('KL25Z', ('ARM', )), ('LPC11U24', ('ARM', 'uARM')), ('LPC1768', ('ARM', 'GCC_ARM', 'GCC_CR', 'GCC_CS', 'IAR')), ('LPC2368', ('ARM', )), ('LPC812', ('uARM', )), ('LPC1347', ('ARM', )), ('LPC4088', ('ARM', ))) if __name__ == '__main__': start = time() failures = [] successes = [] for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD: for toolchain in toolchains: id = "%s::%s" % (target_name, toolchain) try: build_mbed_libs(TARGET_MAP[target_name], toolchain) successes.append(id) except Exception, e: failures.append(id) print e # Write summary of the builds print "\n\nCompleted in: (%.2f)s" % (time() - start) if successes: print "\n\nBuild successes:" print "\n".join([" * %s" % s for s in successes]) if failures: print "\n\nBuild failures:" print "\n".join([" * %s" % f for f in failures])
if options.official_only: toolchains = (getattr(TARGET_MAP[target_name], 'default_toolchain', 'ARM'),) else: toolchains = toolchain_list if options.toolchains: print "Only building using the following toolchains: %s" % (options.toolchains) toolchainSet = set(toolchains) toolchains = toolchainSet.intersection(set((options.toolchains).split(','))) for toolchain in toolchains: id = "%s::%s" % (target_name, toolchain) try: built_mbed_lib = build_mbed_libs(TARGET_MAP[target_name], toolchain, verbose=options.verbose, jobs=options.jobs, report=build_report, properties=build_properties) except Exception, e: print str(e) # Write summary of the builds if options.report_build_file_name: file_report_exporter = ReportExporter(ResultExporterType.JUNIT, package="build") file_report_exporter.report_to_file(build_report, options.report_build_file_name, test_suite_properties=build_properties) print "\n\nCompleted in: (%.2f)s" % (time() - start) print_report_exporter = ReportExporter(ResultExporterType.PRINT, package="build") status = print_report_exporter.report(build_report) if not status: