コード例 #1
0
ファイル: test_capi2.py プロジェクト: tunghoang290780/fusesoc
def test_capi2_get_work_root():
    from fusesoc.core import Core

    core_file = os.path.join(tests_dir, "capi2_cores", "misc", "targets.core")
    core = Core(core_file)

    with pytest.raises(SyntaxError):
        core.get_work_root({})
    assert "default-icarus" == core.get_work_root({"tool": "icarus"})
    assert "default-vivado" == core.get_work_root({"tool": "vivado"})
    assert "default-icarus" == core.get_work_root({"tool": "icarus", "target": None})
    with pytest.raises(SyntaxError):
        core.get_work_root({"tool": "icarus", "target": "invalid_target"})
    assert "empty_target-icarus" == core.get_work_root(
        {"tool": "icarus", "target": "empty_target"}
    )
コード例 #2
0
ファイル: test_capi2.py プロジェクト: snx90/fusesoc
def test_capi2_get_work_root():
    from fusesoc.core import Core

    core_file = os.path.join(tests_dir,
                             "capi2_cores",
                             "misc",
                             "targets.core")
    core = Core(core_file)

    with pytest.raises(SyntaxError):
        core.get_work_root({})
    assert 'default-icarus'      == core.get_work_root({'tool' : 'icarus'})
    assert 'default-vivado'      == core.get_work_root({'tool' : 'vivado'})
    assert 'default-icarus'      == core.get_work_root({'tool' : 'icarus',
                                                        'target' : None})
    with pytest.raises(SyntaxError):
        core.get_work_root({'tool' : 'icarus', 'target' : 'invalid_target'})
    assert 'empty_target-icarus' == core.get_work_root({'tool' : 'icarus', 'target' : 'empty_target'})
コード例 #3
0
ファイル: test_capi2.py プロジェクト: olofk/fusesoc
def test_capi2_get_work_root():
    from fusesoc.core import Core

    core_file = os.path.join(tests_dir,
                             "capi2_cores",
                             "misc",
                             "targets.core")
    core = Core(core_file)

    with pytest.raises(SyntaxError):
        core.get_work_root({})
    assert 'default-icarus'      == core.get_work_root({'tool' : 'icarus'})
    assert 'default-vivado'      == core.get_work_root({'tool' : 'vivado'})
    assert 'default-icarus'      == core.get_work_root({'tool' : 'icarus',
                                                        'target' : None})
    with pytest.raises(SyntaxError):
        core.get_work_root({'tool' : 'icarus', 'target' : 'invalid_target'})
    assert 'empty_target-icarus' == core.get_work_root({'tool' : 'icarus', 'target' : 'empty_target'})