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

Side by Side Diff: Lib/distutils/tests/test_cygwinccompiler.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_config_cmd.py ('k') | Lib/distutils/tests/test_install_lib.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.cygwinccompiler.""" 1 """Tests for distutils.cygwinccompiler."""
2 import unittest 2 import unittest
3 import sys 3 import sys
4 import os 4 import os
5 from io import BytesIO 5 from io import BytesIO
6 import subprocess
7 from test.support import run_unittest 6 from test.support import run_unittest
8 7
9 from distutils import cygwinccompiler 8 # Importing cygwinccompiler attempts to import other tools
10 from distutils.cygwinccompiler import (CygwinCCompiler, check_config_h, 9 # that may not exist unless you're on win32.
11 CONFIG_H_OK, CONFIG_H_NOTOK, 10 if sys.platform == 'win32':
12 CONFIG_H_UNCERTAIN, get_versions, 11 from distutils import cygwinccompiler
13 get_msvcr) 12 from distutils.cygwinccompiler import (check_config_h,
13 CONFIG_H_OK, CONFIG_H_NOTOK,
14 CONFIG_H_UNCERTAIN, get_versions,
15 get_msvcr)
14 from distutils.tests import support 16 from distutils.tests import support
15 17
16 class FakePopen(object): 18 class FakePopen(object):
17 test_class = None 19 test_class = None
18 20
19 def __init__(self, cmd, shell, stdout): 21 def __init__(self, cmd, shell, stdout):
20 self.cmd = cmd.split()[0] 22 self.cmd = cmd.split()[0]
21 exes = self.test_class._exes 23 exes = self.test_class._exes
22 if self.cmd in exes: 24 if self.cmd in exes:
23 # issue #6438 in Python 3.x, Popen returns bytes 25 # issue #6438 in Python 3.x, Popen returns bytes
24 self.stdout = BytesIO(exes[self.cmd]) 26 self.stdout = BytesIO(exes[self.cmd])
25 else: 27 else:
26 self.stdout = os.popen(cmd, 'r') 28 self.stdout = os.popen(cmd, 'r')
27 29
28 30
31 @unittest.skipUnless(sys.platform == "win32", "These tests are only for win32")
29 class CygwinCCompilerTestCase(support.TempdirManager, 32 class CygwinCCompilerTestCase(support.TempdirManager,
30 unittest.TestCase): 33 unittest.TestCase):
31 34
32 def setUp(self): 35 def setUp(self):
33 super(CygwinCCompilerTestCase, self).setUp() 36 super(CygwinCCompilerTestCase, self).setUp()
34 self.version = sys.version 37 self.version = sys.version
35 self.python_h = os.path.join(self.mkdtemp(), 'python.h') 38 self.python_h = os.path.join(self.mkdtemp(), 'python.h')
36 from distutils import sysconfig 39 from distutils import sysconfig
37 self.old_get_config_h_filename = sysconfig.get_config_h_filename 40 self.old_get_config_h_filename = sysconfig.get_config_h_filename
38 sysconfig.get_config_h_filename = self._get_config_h_filename 41 sysconfig.get_config_h_filename = self._get_config_h_filename
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 # unknown 149 # unknown
147 sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) ' 150 sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
148 '[MSC v.1999 32 bits (Intel)]') 151 '[MSC v.1999 32 bits (Intel)]')
149 self.assertRaises(ValueError, get_msvcr) 152 self.assertRaises(ValueError, get_msvcr)
150 153
151 def test_suite(): 154 def test_suite():
152 return unittest.makeSuite(CygwinCCompilerTestCase) 155 return unittest.makeSuite(CygwinCCompilerTestCase)
153 156
154 if __name__ == '__main__': 157 if __name__ == '__main__':
155 run_unittest(test_suite()) 158 run_unittest(test_suite())
OLDNEW
« no previous file with comments | « Lib/distutils/tests/test_config_cmd.py ('k') | Lib/distutils/tests/test_install_lib.py » ('j') | no next file with comments »

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