Esempio n. 1
0
 def test_render(self):
     self.fs.CreateFile('needs.json', contents=textwrap.dedent('''\
         libraries:
             mylib:
                 {% set bar = 'bar' -%}
                 directory: {{bar}}
     '''))
     needy = Needy(needy_configuration=NeedyConfiguration(None))
     self.assertEqual(needy.render().strip(), textwrap.dedent('''\
         libraries:
             mylib:
                 directory: bar
     ''').strip())
Esempio n. 2
0
 def test_libraries_to_build(self):
     self.fs.CreateFile('needs.json', contents=json.dumps({
         'libraries': {
             'excluded': {},
             'dependant': {
                 'dependencies': 'dependency'
             },
             'dependency': {}
         }
     }))
     needy = Needy(needy_configuration=NeedyConfiguration(None))
     libraries = needy.libraries_to_build(needy.target('host'), ['dependant'])
     self.assertEqual(len(libraries), 2)
     self.assertEqual(libraries[0][0], 'dependency')
     self.assertEqual(libraries[1][0], 'dependant')
Esempio n. 3
0
 def test_find_needs_file_with_multiple(self):
     self.fs.CreateFile('needs.json')
     self.fs.CreateFile('needs.yaml')
     with self.assertRaises(RuntimeError):
         Needy.find_needs_file('.')
Esempio n. 4
0
 def source_directory(self, library, target=Target(host_platform()())):
     needy = Needy(self.path())
     return needy.source_directory(library)
Esempio n. 5
0
 def test_find_needs_file_with_yaml_only(self):
     self.fs.CreateFile('needs.yaml')
     self.assertEqual(Needy.find_needs_file('.'), os.path.sep + 'needs.yaml')
Esempio n. 6
0
 def needs_directory(self):
     needy = Needy(self.path())
     return needy.needs_directory()
Esempio n. 7
0
 def build_directory(self,
                     library,
                     target_or_universal_binary=Target(host_platform()())):
     needy = Needy(self.path())
     return needy.build_directory(library, target_or_universal_binary)
Esempio n. 8
0
 def build_directory(self, library, target_or_universal_binary=Target(host_platform()())):
     needy = Needy(self.path())
     return needy.build_directory(library, target_or_universal_binary)
Esempio n. 9
0
 def pkg_config_path(self):
     needy = Needy(self.path())
     return needy.pkg_config_path(Target(host_platform()()))
Esempio n. 10
0
 def source_directory(self, library, target=Target(host_platform()())):
     needy = Needy(self.path())
     return needy.source_directory(library)
Esempio n. 11
0
 def test_find_needs_file_with_multiple(self):
     self.fs.CreateFile('needs.json')
     self.fs.CreateFile('needs.yaml')
     with self.assertRaises(RuntimeError):
         Needy.find_needs_file('.')
Esempio n. 12
0
 def test_find_needs_file_with_yaml_only(self):
     self.fs.CreateFile('needs.yaml')
     self.assertEqual(Needy.find_needs_file('.'),
                      os.path.sep + 'needs.yaml')