Beispiel #1
0
    def test_tb_filter_warning_on_missing_runner_cfg_when_matching_tb_pattern(
            self):
        design_unit = Module('tb_module_not_ok')
        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)
            ])
Beispiel #2
0
    def test_tb_filter_requires_runner_cfg(self):
        design_unit = Entity('tb_entity')
        design_unit.generic_names = ["runner_cfg"]
        self.assertTrue(tb_filter(design_unit))

        design_unit = Entity('tb_entity')
        design_unit.generic_names = []
        self.assertFalse(tb_filter(design_unit))

        design_unit = Module('tb_module')
        design_unit.generic_names = ["runner_cfg"]
        self.assertTrue(tb_filter(design_unit))

        design_unit = Module('tb_module')
        design_unit.generic_names = []
        self.assertFalse(tb_filter(design_unit))
Beispiel #3
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))
Beispiel #4
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=join(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)])
    def test_tb_filter_warning_on_missing_runner_cfg_when_matching_tb_pattern(
        self, tempdir
    ):
        design_unit = Module("tb_module_not_ok", file_name=join(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,
                    )
                ]
            )