Ejemplo n.º 1
0
class PathListTestCase(unittest.TestCase):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.lst = PathList(Path('/tmp'), '1', '2')

    def test_nominal(self):
        self.assertTrue(self.lst.absolute() ==
                        [Path('/tmp/1'), Path('/tmp/2')])
        lst = copy.deepcopy(self.lst)
        lst.append(Path('/usr/lib'))
        print(lst.absolute())
        self.assertTrue(lst.absolute(
        ) == [Path('/tmp/1'), Path('/tmp/2'),
              Path('/usr/lib')])

    def test_update_path_list(self):
        lst = copy.deepcopy(self.lst)
        lst.extend(PathList(Path('/usr'), 'lib'))
        self.assertTrue(lst.absolute(
        ) == [Path('/tmp/1'), Path('/tmp/2'),
              Path('/usr/lib')])
Ejemplo n.º 2
0
 def make_link_dirs_option(self, link_dirs: PathList):
     return [f'/LIBPATH:{d.as_posix()}' for d in link_dirs.absolute()]
Ejemplo n.º 3
0
 def make_link_dirs_option(self, link_dirs: PathList):
     return [f'-L{d}' for d in link_dirs.absolute()]
Ejemplo n.º 4
0
 def make_include_dirs_option(self, include_dirs: PathList):
     return [f'/I{d.as_posix()}' for d in include_dirs.absolute()]
Ejemplo n.º 5
0
 def make_include_dirs_option(self, include_dirs: PathList):
     return [f'-I{d}' for d in include_dirs.absolute()]