Esempio n. 1
0
 def _create_tests(self, simulator_if):
     scanner = TestScanner(simulator_if,
                           self._configuration,
                           elaborate_only=self._elaborate_only)
     test_list = scanner.from_project(self._project,
                                      entity_filter=self._tb_filter)
     test_list.keep_matches(self._test_filter)
     return test_list
Esempio n. 2
0
    def setUp(self):
        self.simulator_if = 'simulator_if'
        self.test_scanner = TestScanner(self.simulator_if, TestConfiguration())

        self.output_path = join(dirname(__file__), "test_scanner_out")

        if exists(self.output_path):
            rmtree(self.output_path)
        makedirs(self.output_path)
Esempio n. 3
0
    def _create_tests(self, simulator_if):
        """
        Create the test suites by scanning the project
        """
        scanner = TestScanner(simulator_if,
                              self._configuration,
                              elaborate_only=self._elaborate_only)
        test_list = scanner.from_project(self._project, entity_filter=self._tb_filter)

        if test_list.num_tests() == 0:
            LOGGER.warning("Test scanner found no test benches using current filter rule:\n%s",
                           self._tb_filter.__doc__)

        test_list.keep_matches(self._test_filter)
        return test_list
Esempio n. 4
0
 def helper(config_name, suffix):
     """
     Add config with name and check that the test has the given suffix
     """
     project = ProjectStub()
     lib = project.add_library("lib")
     lib.add_entity("tb_entity",
                    generic_names=["runner_cfg"])
     self.configuration = TestConfiguration()
     self.test_scanner = TestScanner(self.simulator_if, self.configuration)
     self.configuration.add_config(scope=create_scope("lib", "tb_entity"),
                                   name=config_name,
                                   generics=dict())
     tests = self.test_scanner.from_project(project)
     self.assert_has_tests(tests,
                           ["lib.tb_entity" + suffix])
Esempio n. 5
0
 def setUp(self):
     self.simulator_if = 'simulator_if'
     self.configuration = TestConfiguration()
     self.test_scanner = TestScanner(self.simulator_if, self.configuration)
     self.output_path = join(dirname(__file__), "test_scanner_out")
     renew_path(self.output_path)