Esempio n. 1
0
def setup_test_user_prj():
    if exists(USER_PRJ):
        print 'Test user project already generated...'
        return

    setup_user_prj(USER_PRJ, join(TEST_DIR, "rtos", "mbed", "basic"), [join(LIB_DIR, "rtos")])

    # FAKE BUILD URL
    open(join(USER_SRC, "mbed.bld"), 'w').write("http://mbed.org/users/mbed_official/code/mbed/builds/976df7c37ad5\n")
Esempio n. 2
0
    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 report['success']:
        zip_path = join(EXPORT_DIR, "%s_%s_%s.zip" % (test.id, ide, mcu))
        move(tmp_path, zip_path)
        print "[OK]"
    else:
        print '[ERRROR] %s' % report['errormsg']
Esempio n. 3
0
        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:
                test.dependencies.remove(MBED_LIBRARIES)
                test.dependencies.append(MBED_BASE)

        # Build the project with 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, extra_symbols=lib_symbols)
        if report['success']:
            zip_path = join(EXPORT_DIR, "%s_%s_%s.zip" % (test.id, ide, mcu))
            move(tmp_path, zip_path)
            successes.append("%s::%s\t%s"% (mcu, ide, zip_path))
        else:
            failures.append("%s::%s\t%s"% (mcu, ide, report['errormsg']))

    # Prints export results
    print
    if len(successes) > 0:
        print "Successful exports:"
        for success in successes: