当前位置: 首页>>代码示例>>Python>>正文


Python Project.update方法代码示例

本文整理汇总了Python中vunit.project.Project.update方法的典型用法代码示例。如果您正苦于以下问题:Python Project.update方法的具体用法?Python Project.update怎么用?Python Project.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vunit.project.Project的用法示例。


在下文中一共展示了Project.update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TestProject

# 需要导入模块: from vunit.project import Project [as 别名]
# 或者: from vunit.project.Project import update [as 别名]

#.........这里部分代码省略.........
        self.project.add_library("lib2", "lib2_path")

        foo_arch = self.add_source_file("lib1", "foo_arch.vhd", """
architecture arch of foo is
begin
end architecture;
""")

        foo1_ent = self.add_source_file("lib1", "foo1_ent.vhd", """
entity foo is
port (signal bar : boolean);
end entity;
""")

        self.add_source_file("lib2", "foo2_ent.vhd", """
entity foo is
end entity;
""")

        self.assert_compiles(foo1_ent, before=foo_arch)

    def test_multiple_identical_file_names_with_different_path_in_same_library(self):
        self.project.add_library("lib", "lib_path")
        a_foo = self.add_source_file("lib", join("a", "foo.vhd"), """
entity a_foo is
end entity;
""")

        b_foo = self.add_source_file("lib", join("b", "foo.vhd"), """
entity b_foo is
end entity;
""")
        self.assert_should_recompile([a_foo, b_foo])
        self.update(a_foo)
        self.assert_should_recompile([b_foo])
        self.update(b_foo)
        self.assert_should_recompile([])

    def test_finds_entity_architecture_dependencies(self):
        self.project.add_library("lib", "lib_path")
        entity = self.add_source_file("lib", "entity.vhd", """
entity foo is
end entity;
""")

        arch1 = self.add_source_file("lib", "arch1.vhd", """
architecture arch1 of foo is
begin
end architecture;
""")

        arch2 = self.add_source_file("lib", "arch2.vhd", """
architecture arch2 of foo is
begin
end architecture;
""")
        self.assert_compiles(entity, before=arch1)
        self.assert_compiles(entity, before=arch2)

    def test_finds_package_dependencies(self):
        self.project.add_library("lib", "lib_path")
        package = self.add_source_file("lib", "package.vhd", """
package foo is
end package;
""")
开发者ID:go2sh,项目名称:vunit,代码行数:69,代码来源:test_project.py

示例2: TestProject

# 需要导入模块: from vunit.project import Project [as 别名]
# 或者: from vunit.project.Project import update [as 别名]

#.........这里部分代码省略.........
begin
end package body;
""")
        self.assert_has_package("file1.vhd", "foo")
        self.assert_has_package_body("file1.vhd", "foo")

    def test_finds_entity_instantiation_dependencies(self):
        self.create_dummy_three_file_project()

        self.assert_compiles("file1.vhd", before="file2.vhd")
        self.assert_compiles("file2.vhd", before="file3.vhd")

    def test_primary_with_same_name_in_multiple_libraries_secondary_dependency(self):
        self.project.add_library("lib1", "lib1_path")
        self.project.add_library("lib2", "lib2_path")

        self.add_source_file("lib1", "foo_arch.vhd", """
architecture arch of foo is
begin
end architecture;
""")

        self.add_source_file("lib1", "foo1_ent.vhd", """
entity foo is
port (signal bar : boolean);
end entity;
""")

        self.add_source_file("lib2", "foo2_ent.vhd", """
entity foo is
end entity;
""")

        self.update("foo_arch.vhd")
        self.update("foo1_ent.vhd")
        self.update("foo2_ent.vhd")
        self.assert_should_recompile([])

        tick()
        self.update("foo1_ent.vhd")
        self.assert_should_recompile(["foo_arch.vhd"])

    def test_multiple_identical_file_names_with_different_path_in_same_library(self):
        self.project.add_library("lib", "lib_path")
        self.add_source_file("lib", join("a", "foo.vhd"), """
entity a_foo is
end entity;
""")

        self.add_source_file("lib", join("b", "foo.vhd"), """
entity b_foo is
end entity;
""")
        self.assert_should_recompile([join("a", "foo.vhd"), join("b", "foo.vhd")])
        self.update(join("a", "foo.vhd"))
        self.update(join("b", "foo.vhd"))
        self.assert_should_recompile([])

    def test_finds_entity_architecture_dependencies(self):
        self.project.add_library("lib", "lib_path")
        self.add_source_file("lib", "entity.vhd", """
entity foo is
end entity;
""")

        self.add_source_file("lib", "arch1.vhd", """
开发者ID:enzochiau,项目名称:vunit,代码行数:70,代码来源:test_project.py

示例3: TestProject

# 需要导入模块: from vunit.project import Project [as 别名]
# 或者: from vunit.project.Project import update [as 别名]

#.........这里部分代码省略.........
end package body;
""")
        self.assert_has_package("file1.vhd", "foo")
        self.assert_has_package_body("file1.vhd", "foo")


    def test_finds_entity_instantiation_dependencies(self):
        self.create_dummy_three_file_project()

        self.assert_compiles_before("file1.vhd", before="file2.vhd")
        self.assert_compiles_before("file2.vhd", before="file3.vhd")

    def test_primary_with_same_name_in_multiple_libraries_secondary_dependency(self):
        self.project.add_library("lib1", "lib1_path")
        self.project.add_library("lib2", "lib2_path")

        self.add_source_file("lib1", "foo_arch.vhd", """
architecture arch of foo is
begin
end architecture;
""")

        self.add_source_file("lib1", "foo1_ent.vhd", """
entity foo is
port (signal bar : boolean);
end entity;
""")

        self.add_source_file("lib2", "foo2_ent.vhd", """
entity foo is
end entity;
""")

        self.update("foo_arch.vhd")
        self.update("foo1_ent.vhd")
        self.update("foo2_ent.vhd")
        self.assert_should_recompile([])

        self.stub.tick()
        self.update("foo1_ent.vhd")
        self.assert_should_recompile(["foo_arch.vhd"])
        
    def test_multiple_identical_file_names_with_different_path_in_same_library(self):
        self.project.add_library("lib", "lib_path")
        self.add_source_file("lib", join("a", "foo.vhd"), """
entity a_foo is
end entity;
""")

        self.add_source_file("lib", join("b", "foo.vhd"), """
entity b_foo is
end entity;
""")
        self.assert_should_recompile([join("a", "foo.vhd"), join("b", "foo.vhd")])
        self.update(join("a", "foo.vhd"))
        self.update(join("b", "foo.vhd"))
        self.assert_should_recompile([])

    def test_finds_entity_architecture_dependencies(self):
        self.project.add_library("lib", "lib_path")
        self.add_source_file("lib", "entity.vhd", """
entity foo is
end entity;
""")

        self.add_source_file("lib", "arch1.vhd", """
开发者ID:tomasnilefrost,项目名称:vunit,代码行数:70,代码来源:test_project.py


注:本文中的vunit.project.Project.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。