Beispiel #1
0
 def test_format(self):
     with mock.patch('bfg9000.builtins.packages.which', mock_which):
         self.assertEqual(
             packages.system_executable(self.env, 'name', 'format'),
             file_types.Executable(abspath('/command'), 'format'))
Beispiel #2
0
 def test_src_file(self):
     result = self.builtin_dict['executable']('executable')
     self.assertEqual(
         result, file_types.Executable(Path('executable', Root.srcdir),
                                       None))
Beispiel #3
0
 def test_name(self):
     with mock.patch('bfg9000.builtins.packages.which', mock_which):
         self.assertEqual(
             packages.system_executable(self.env, 'name'),
             file_types.Executable(abspath('/command'),
                                   self.env.target_platform.object_format))
Beispiel #4
0
 def test_identity(self):
     exe = file_types.Executable(Path('executable', Root.srcdir), None)
     result = self.builtin_dict['executable'](exe)
     self.assertEqual(result, exe)
Beispiel #5
0
 def test_output_file(self):
     fmt = self.env.target_platform.object_format
     ext = self.env.target_platform.executable_ext
     self.assertEqual(self.linker.output_file('prog', None),
                      file_types.Executable(Path('prog' + ext), fmt, 'c++'))
Beispiel #6
0
 def test_identity(self):
     expected = file_types.Executable(Path('exe', Root.srcdir), None)
     self.assertIs(self.context['executable'](expected), expected)
Beispiel #7
0
 def test_format(self):
     with mock.patch('bfg9000.builtins.packages.which', mock_which):
         self.assertEqual(
             self.context['system_executable']('name', 'format'),
             file_types.Executable(abspath('/name'), 'format'))
 def setUp(self):
     self.env = make_env()
     with mock.patch('bfg9000.shell.which', return_value=['command']):
         self.tool = self.env.tool('install_name_tool')
     self.install_db = MockInstallOutputs(self.env)
     self.exe = file_types.Executable(Path('exe'), None)