コード例 #1
0
ファイル: test_needy.py プロジェクト: ccbrown/needy
    def test_status(self):
        empty_directory = os.path.join(self.path(), 'empty')
        os.makedirs(empty_directory)
        with open(os.path.join(self.path(), 'needs.json'), 'w') as needs_file:
            needs_file.write(json.dumps({
                'libraries': {
                    'project': {
                        'directory': empty_directory,
                        'project': {
                            'build-steps': 'echo foo > bar'
                        }
                    }
                },
                'universal-binaries': {
                    'ub': {
                        'host': [host_platform()().default_architecture()]
                    }
                }
            }))
        self.assertEqual(self.execute(['status']), 0)
        self.assertEqual(self.execute(['status', '-u', 'ub']), 0)
        self.assertEqual(self.execute(['satisfy', 'project']), 0)
        self.assertEqual(self.execute(['status']), 0)
        self.assertEqual(self.execute(['status', '-u', 'ub']), 0)

        # same thing with dev mode
        self.assertEqual(self.execute(['dev', 'enable', 'project']), 0)
        self.assertEqual(self.execute(['status']), 0)
        self.assertEqual(self.execute(['status', '-u', 'ub']), 0)
        self.assertEqual(self.execute(['satisfy', 'project']), 0)
        self.assertEqual(self.execute(['status']), 0)
        self.assertEqual(self.execute(['status', '-u', 'ub']), 0)
コード例 #2
0
ファイル: test_needy.py プロジェクト: vmrob/needy
    def test_status(self):
        empty_directory = os.path.join(self.path(), 'empty')
        os.makedirs(empty_directory)
        with open(os.path.join(self.path(), 'needs.json'), 'w') as needs_file:
            needs_file.write(
                json.dumps({
                    'libraries': {
                        'project': {
                            'directory': empty_directory,
                            'project': {
                                'build-steps': 'echo foo > bar'
                            }
                        }
                    },
                    'universal-binaries': {
                        'ub': {
                            'host': [host_platform()().default_architecture()]
                        }
                    }
                }))
        self.assertEqual(self.execute(['status']), 0)
        self.assertEqual(self.execute(['status', '-u', 'ub']), 0)
        self.assertEqual(self.execute(['satisfy', 'project']), 0)
        self.assertEqual(self.execute(['status']), 0)
        self.assertEqual(self.execute(['status', '-u', 'ub']), 0)

        # same thing with dev mode
        self.assertEqual(self.execute(['dev', 'enable', 'project']), 0)
        self.assertEqual(self.execute(['status']), 0)
        self.assertEqual(self.execute(['status', '-u', 'ub']), 0)
        self.assertEqual(self.execute(['satisfy', 'project']), 0)
        self.assertEqual(self.execute(['status']), 0)
        self.assertEqual(self.execute(['status', '-u', 'ub']), 0)
コード例 #3
0
ファイル: test_needy.py プロジェクト: ccbrown/needy
 def test_yaml_jinja(self):
     empty_directory = os.path.join(self.path(), 'empty')
     os.makedirs(empty_directory)
     with open(os.path.join(self.path(), 'needs.yaml'), 'w') as needs_file:
         needs_file.write(textwrap.dedent('''
             libraries:
                 mylib:
                     directory: {empty_directory}
                     build-directory-suffix: suffix
                     project:
                         build-steps:
                             - echo {{{{ build_directory('mylib') }}}} | {match_command} "suffix"
                             - echo {{{{ architecture }}}} | {match_command} "{architecture}"
             universal-binaries:
                 ub:
                     host: ['{architecture}']
         ''').format(
             empty_directory=empty_directory,
             match_command='findstr' if sys.platform == 'win32' else 'grep',
             architecture=host_platform()().default_architecture()
         ))
     self.assertEqual(self.execute(['satisfy', '-u', 'ub']), 0)
コード例 #4
0
ファイル: test_needy.py プロジェクト: vmrob/needy
 def test_yaml_jinja(self):
     empty_directory = os.path.join(self.path(), 'empty')
     os.makedirs(empty_directory)
     with open(os.path.join(self.path(), 'needs.yaml'), 'w') as needs_file:
         needs_file.write(
             textwrap.dedent('''
             libraries:
                 mylib:
                     directory: {empty_directory}
                     build-directory-suffix: suffix
                     project:
                         build-steps:
                             - echo {{{{ build_directory('mylib') }}}} | {match_command} "suffix"
                             - echo {{{{ architecture }}}} | {match_command} "{architecture}"
             universal-binaries:
                 ub:
                     host: ['{architecture}']
         ''').format(empty_directory=empty_directory,
                     match_command='findstr'
                     if sys.platform == 'win32' else 'grep',
                     architecture=host_platform()().default_architecture()))
     self.assertEqual(self.execute(['satisfy', '-u', 'ub']), 0)
コード例 #5
0
ファイル: test_project.py プロジェクト: ccbrown/needy
 def test_pre_build_creating_output_directories(self):
     project = Project(ProjectDefinition(Target(host_platform()()), '.'), None)
     project.pre_build(os.path.join('build', 'out'))
     self.assertTrue(os.path.isdir(os.path.join('build', 'out', 'include')))
     self.assertTrue(os.path.isdir(os.path.join('build', 'out', 'lib')))
コード例 #6
0
ファイル: functional_test.py プロジェクト: vmrob/needy
 def pkg_config_path(self):
     needy = Needy(self.path())
     return needy.pkg_config_path(Target(host_platform()()))
コード例 #7
0
ファイル: functional_test.py プロジェクト: vmrob/needy
 def source_directory(self, library, target=Target(host_platform()())):
     needy = Needy(self.path())
     return needy.source_directory(library)
コード例 #8
0
ファイル: functional_test.py プロジェクト: vmrob/needy
 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)
コード例 #9
0
ファイル: functional_test.py プロジェクト: ccbrown/needy
 def pkg_config_path(self):
     needy = Needy(self.path())
     return needy.pkg_config_path(Target(host_platform()()))
コード例 #10
0
ファイル: functional_test.py プロジェクト: ccbrown/needy
 def source_directory(self, library, target=Target(host_platform()())):
     needy = Needy(self.path())
     return needy.source_directory(library)
コード例 #11
0
ファイル: functional_test.py プロジェクト: ccbrown/needy
 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)
コード例 #12
0
 def test_pre_build_creating_output_directories(self):
     project = Project(ProjectDefinition(Target(host_platform()()), '.'),
                       None)
     project.pre_build(os.path.join('build', 'out'))
     self.assertTrue(os.path.isdir(os.path.join('build', 'out', 'include')))
     self.assertTrue(os.path.isdir(os.path.join('build', 'out', 'lib')))