Exemplo n.º 1
0
 def test_generate_pkgconfig_with_single_lib(self):
     self.fs.CreateFile(os.path.join('lib', 'libtest.a'))
     Library.generate_pkgconfig('.', 'test')
     self.assertTrue(
         os.path.exists(os.path.join('lib', 'pkgconfig', 'test.pc')))
     with open(os.path.join('lib', 'pkgconfig', 'test.pc'), 'r') as f:
         self.assertTrue('-ltest' in f.read())
Exemplo n.º 2
0
    def test_generate_pkgconfig_with_multiple_libs(self):
        self.fs.CreateFile(os.path.join('lib', 'liba.a'))
        self.fs.CreateFile(os.path.join('lib', 'libb.a'))
        Library.generate_pkgconfig('.', 'test')

        self.assertTrue(os.path.exists(os.path.join('lib', 'pkgconfig', 'a.pc')))
        with open(os.path.join('lib', 'pkgconfig', 'a.pc'), 'r') as f:
            self.assertTrue('-la' in f.read())

        self.assertTrue(os.path.exists(os.path.join('lib', 'pkgconfig', 'b.pc')))
        with open(os.path.join('lib', 'pkgconfig', 'b.pc'), 'r') as f:
            self.assertTrue('-lb' in f.read())

        self.assertTrue(os.path.exists(os.path.join('lib', 'pkgconfig', 'test.pc')))
        with open(os.path.join('lib', 'pkgconfig', 'test.pc'), 'r') as f:
            contents = f.read()
            self.assertTrue('-la' in contents)
            self.assertTrue('-lb' in contents)
Exemplo n.º 3
0
    def test_generate_pkgconfig_with_multiple_libs(self):
        self.fs.CreateFile(os.path.join('lib', 'liba.a'))
        self.fs.CreateFile(os.path.join('lib', 'libb.a'))
        Library.generate_pkgconfig('.', 'test')

        self.assertTrue(
            os.path.exists(os.path.join('lib', 'pkgconfig', 'a.pc')))
        with open(os.path.join('lib', 'pkgconfig', 'a.pc'), 'r') as f:
            self.assertTrue('-la' in f.read())

        self.assertTrue(
            os.path.exists(os.path.join('lib', 'pkgconfig', 'b.pc')))
        with open(os.path.join('lib', 'pkgconfig', 'b.pc'), 'r') as f:
            self.assertTrue('-lb' in f.read())

        self.assertTrue(
            os.path.exists(os.path.join('lib', 'pkgconfig', 'test.pc')))
        with open(os.path.join('lib', 'pkgconfig', 'test.pc'), 'r') as f:
            contents = f.read()
            self.assertTrue('-la' in contents)
            self.assertTrue('-lb' in contents)
Exemplo n.º 4
0
 def test_generate_pkgconfig_with_single_lib(self):
     self.fs.CreateFile(os.path.join('lib', 'libtest.a'))
     Library.generate_pkgconfig('.', 'test')
     self.assertTrue(os.path.exists(os.path.join('lib', 'pkgconfig', 'test.pc')))
     with open(os.path.join('lib', 'pkgconfig', 'test.pc'), 'r') as f:
         self.assertTrue('-ltest' in f.read())
Exemplo n.º 5
0
 def test_generate_pkgconfig_with_no_lib(self):
     Library.generate_pkgconfig('.', 'test')
     self.assertTrue(os.path.exists(os.path.join('lib', 'pkgconfig', 'test.pc')))
Exemplo n.º 6
0
 def test_generate_pkgconfig_with_no_lib(self):
     Library.generate_pkgconfig('.', 'test')
     self.assertTrue(
         os.path.exists(os.path.join('lib', 'pkgconfig', 'test.pc')))