Ejemplo n.º 1
0
    def test_tb_filter_requires_runner_cfg(self, tempdir):
        design_unit = Entity("tb_entity", file_name=join(tempdir, "file.vhd"))
        design_unit.generic_names = ["runner_cfg"]
        self.assertTrue(tb_filter(design_unit))

        design_unit = Entity("tb_entity", file_name=join(tempdir, "file.vhd"))
        design_unit.generic_names = []
        self.assertFalse(tb_filter(design_unit))

        design_unit = Module("tb_module", file_name=join(tempdir, "file.vhd"))
        design_unit.generic_names = ["runner_cfg"]
        self.assertTrue(tb_filter(design_unit))

        design_unit = Module("tb_module", file_name=join(tempdir, "file.vhd"))
        design_unit.generic_names = []
        self.assertFalse(tb_filter(design_unit))
Ejemplo n.º 2
0
    def test_tb_filter_warning_on_missing_runner_cfg_when_matching_tb_pattern(self, tempdir):
        design_unit = Module("tb_module_not_ok", file_name=str(Path(tempdir) / "file.vhd"))
        design_unit.generic_names = []

        with mock.patch("vunit.test.bench_list.LOGGER", autospec=True) as logger:
            self.assertFalse(tb_filter(design_unit))
            logger.warning.assert_has_calls(
                [
                    mock.call(
                        "%s %s matches testbench name regex %s "
                        "but has no %s runner_cfg and will therefore not be run.\n"
                        "in file %s",
                        "Module",
                        "tb_module_not_ok",
                        "^(tb_.*)|(.*_tb)$",
                        "parameter",
                        design_unit.file_name,
                    )
                ]
            )