Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(93062)

Side by Side Diff: Lib/distutils/tests/test_sysconfig.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/distutils/tests/test_spawn.py ('k') | Lib/distutils/tests/test_util.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """Tests for distutils.sysconfig.""" 1 """Tests for distutils.sysconfig."""
2 import os 2 import os
3 import shutil 3 import shutil
4 import subprocess 4 import subprocess
5 import sys 5 import sys
6 import textwrap 6 import textwrap
7 import unittest 7 import unittest
8 8
9 from distutils import sysconfig 9 from distutils import sysconfig
10 from distutils.ccompiler import get_default_compiler 10 from distutils.ccompiler import get_default_compiler
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 self.assertEqual(sysconfig.get_config_var('SO'), 170 self.assertEqual(sysconfig.get_config_var('SO'),
171 sysconfig.get_config_var('EXT_SUFFIX')) 171 sysconfig.get_config_var('EXT_SUFFIX'))
172 172
173 @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None, 173 @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
174 'EXT_SUFFIX required for this test') 174 'EXT_SUFFIX required for this test')
175 def test_SO_in_vars(self): 175 def test_SO_in_vars(self):
176 vars = sysconfig.get_config_vars() 176 vars = sysconfig.get_config_vars()
177 self.assertIsNotNone(vars['SO']) 177 self.assertIsNotNone(vars['SO'])
178 self.assertEqual(vars['SO'], vars['EXT_SUFFIX']) 178 self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])
179 179
180 @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess .Popen()")
180 def test_customize_compiler_before_get_config_vars(self): 181 def test_customize_compiler_before_get_config_vars(self):
181 # Issue #21923: test that a Distribution compiler 182 # Issue #21923: test that a Distribution compiler
182 # instance can be called without an explicit call to 183 # instance can be called without an explicit call to
183 # get_config_vars(). 184 # get_config_vars().
184 with open(TESTFN, 'w') as f: 185 with open(TESTFN, 'w') as f:
185 f.writelines(textwrap.dedent('''\ 186 f.writelines(textwrap.dedent('''\
186 from distutils.core import Distribution 187 from distutils.core import Distribution
187 config = Distribution().get_command_obj('config') 188 config = Distribution().get_command_obj('config')
188 # try_compile may pass or it may fail if no compiler 189 # try_compile may pass or it may fail if no compiler
189 # is found but it should not raise an exception. 190 # is found but it should not raise an exception.
190 rc = config.try_compile('int x;') 191 rc = config.try_compile('int x;')
191 ''')) 192 '''))
192 p = subprocess.Popen([str(sys.executable), TESTFN], 193 p = subprocess.Popen([str(sys.executable), TESTFN],
193 stdout=subprocess.PIPE, 194 stdout=subprocess.PIPE,
194 stderr=subprocess.STDOUT, 195 stderr=subprocess.STDOUT,
195 universal_newlines=True) 196 universal_newlines=True)
196 outs, errs = p.communicate() 197 outs, errs = p.communicate()
197 self.assertEqual(0, p.returncode, "Subprocess failed: " + outs) 198 self.assertEqual(0, p.returncode, "Subprocess failed: " + outs)
198 199
199 200
200 def test_suite(): 201 def test_suite():
201 suite = unittest.TestSuite() 202 suite = unittest.TestSuite()
202 suite.addTest(unittest.makeSuite(SysconfigTestCase)) 203 suite.addTest(unittest.makeSuite(SysconfigTestCase))
203 return suite 204 return suite
204 205
205 206
206 if __name__ == '__main__': 207 if __name__ == '__main__':
207 run_unittest(test_suite()) 208 run_unittest(test_suite())
OLDNEW
« no previous file with comments | « Lib/distutils/tests/test_spawn.py ('k') | Lib/distutils/tests/test_util.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+