Пример #1
0
def boards2csv(csv_path, logger=None):
    csv_path = Path(csv_path).abspath()
    if not logger:
        logger = (lambda x: x)

    targets = arduino.targets()

    fx = open(csv_path, 'wb')
    writer = csv.writer(fx)
    logger('generating ' + csv_path)

    writer.writerow('index package id name MCU F_CPU'.split())

    if not hasattr(boards2csv, 'index'):
        boards2csv.index = 0
    for cc in targets:
        boards2csv.index += 1
        index = boards2csv.index

        writer.writerow([
                        index,
                        cc.hwpack,
                        cc.board,
                        cc.board_options.name,
                        cc.board_options.build.mcu,
                        cc.board_options.build.f_cpu,
                        ])
Пример #2
0
def main():
    cc = Arduino()
#    print 'compiler version:', cc.version()
    print 'code:', cc.minprog
    print
    for mcu in targets():
        cc = Arduino(mcu=mcu)
        test(cc)
Пример #3
0
def main():
    cc = Arduino()
    #    print 'compiler version:', cc.version()
    print 'code:', cc.minprog
    print
    for mcu in targets():
        cc = Arduino(mcu=mcu)
        test(cc)
Пример #4
0
    cc.build(ex)
    assert cc.size().ok


def generate(func, params, labels=None):
    if not labels:
        labels = params
    if not hasattr(func, '_index'):
        func._index = 0
    func._index += 1
    cmd = '''def test_{func._index}_{labels}(): {func.__name__}({params})'''.format(func=func,
                                                                                    params=','.join(
                                                                                    ['"%s"' % x for x in params]),
                                                                                    labels='_'.join(labels))
    logging.debug('cmd:' + cmd)
    return cmd

# def test_build():
#    for ex in examples:
#        for cc in arduino.targets():
#            cc.extra_lib = root
#            if cc.hwpack=='arduino':
#                yield check_build, ex, cc
for ex in examples:
    for cc in arduino.targets():
        if cc.hwpack == 'arduino':
            if (str(path(ex).name), cc.mcu_compiler()) not in fails:
                exec generate(check_build,
                              [ex, cc.hwpack, cc.board],
                              [ex.namebase, cc.hwpack, cc.board])
Пример #5
0
def test_targets_list():
    ok_(len(targets()))