예제 #1
0
    def test_ExpandWithRecursiveWildcardsAndRelativePaths(self):
        # type: (...) -> Any
        """
        Recursive wildcards are only available on Python3, expected result will
        be different but we're not porting it back
        """
        config = {"sources": [p.join("**", "*.sv")]}

        _logger.info("config:\n%s", pformat(config))

        if six.PY3:
            expected = (SourceEntry(Path(x), None, (), (), ()) for x in (
                self.join("some_sv.sv"),
                self.join("dir_0", "some_sv.sv"),
                self.join("dir_0", "dir_1", "some_sv.sv"),
                self.join("dir_2", "some_sv.sv"),
                self.join("dir_2", "dir_3", "some_sv.sv"),
            ))
        else:
            expected = (SourceEntry(Path(x), None, (), (), ()) for x in (
                self.join("dir_0", "some_sv.sv"),
                self.join("dir_2", "some_sv.sv"),
            ))

        self.assertCountEqual(flattenConfig(config, root_path=self.base_path),
                              expected)
예제 #2
0
    def test_ExpandWithFileWildcards(self):
        # type: (...) -> Any
        config = {
            "sources": [
                self.join("*.vhd"),
                self.join("*", "some_v.v"),
                self.join("*", "dir_1", "*.sv"),
            ]
        }

        _logger.info("config:\n%s", pformat(config))

        self.assertCountEqual(
            flattenConfig(config, root_path=self.base_path),
            (SourceEntry(Path(x), None, (), (), ()) for x in (
                self.join("some_vhd.vhd"),
                self.join("dir_0", "some_v.v"),
                self.join("dir_2", "some_v.v"),
                self.join("dir_0", "dir_1", "some_sv.sv"),
            )),
        )