Ejemplo n.º 1
0
def test_TmcFile_configure_packages(example_singular_tmc_chains):
    tmc = TmcFile(None)
    check_list = []
    # build artificial tmcChains and generate fake names
    for idx, tc_type in zip([0, 2, 4, 6], ["BOOL", "INT", "LREAL", "STRING"]):
        cn = example_singular_tmc_chains[idx]
        for element, ix in zip(cn.chain, range(len(cn.chain))):
            element.name = chr(97 + ix)

        cn.last.tc_type = tc_type

        tmc.all_TmcChains.append(cn)

        # create the check_set
        rec = BaseRecordPackage(None, cn)
        rec.generate_naive_config()
        rec.guess_all()
        logger.debug(str(rec.chain.last.pragma.config))
        check_list.append(rec)

    tmc.create_chains()
    tmc.isolate_chains()
    tmc.create_packages()
    tmc.configure_packages()

    assert len(tmc.all_RecordPackages) == 4
    for check, rec in zip(check_list, tmc.all_RecordPackages):
        assert check.cfg.config == rec.cfg.config
        assert check.chain.chain == rec.chain.chain
Ejemplo n.º 2
0
def test_TmcFile_fullbuild(string_tmc_path):
    tmc = TmcFile(string_tmc_path)
    tmc.create_chains()
    tmc.isolate_chains()
    tmc.create_packages()
    tmc.configure_packages()
    z = tmc.render()
    print(z)