test_config_parser.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:hdlcc 作者: suoto 项目源码 文件源码
def test():
            # We'll add no project file, so the only sources that should
            # be fond are VUnit's files
            it.assertIn('vunit', sys.modules)
            project_filename = p.join(TEST_CONFIG_PARSER_SUPPORT_PATH,
                                      'builder_only_project.prj')
            with mock.patch('hdlcc.builders.MSim.file_types',
                            new_callable=mock.PropertyMock,
                            return_value=('vhdl', )):
                parser = ConfigParser(project_filename)
                sources = parser.getSources()

            vunit_files = 0
            for source in sources:
                if 'vunit' in source.filename.lower():
                    vunit_files += 1

            it.assertEqual(len(sources), vunit_files,
                           "We should only find VUnit files")

            # Check that we find no verilog or systemverilog files
            for filetype in ('verilog', 'systemverilog'):
                it.assertNotIn(filetype, [x.filetype for x in sources],
                               "We should only find VUnit VHDL files")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号