summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-04-22 17:13:47 (GMT)
committerGitHub <noreply@github.com>2020-04-22 17:13:47 (GMT)
commit4a6da0b63ba0fb811bfa3cacd69d22a9c0b24a4d (patch)
tree331178197c3a05dc003d08fe01ddfb4058360cdc /Lib/test
parentb07350901cac9197aef41855d8a4d56533636b91 (diff)
downloadcpython-4a6da0b63ba0fb811bfa3cacd69d22a9c0b24a4d.zip
cpython-4a6da0b63ba0fb811bfa3cacd69d22a9c0b24a4d.tar.gz
cpython-4a6da0b63ba0fb811bfa3cacd69d22a9c0b24a4d.tar.bz2
bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)
It is possible to use either '-isysroot /some/path' (with a space) or '-isysroot/some/path' (no space in between). Support both forms in places where special handling of -isysroot is done, rather than just the first form. Co-authored-by: Ned Deily <nad@python.org> (cherry picked from commit b310700976524b4b99ee319c947ca40468716fc9) Co-authored-by: Joshua Root <jmr@macports.org>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test__osx_support.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py
index 388a2b1..1a5d649 100644
--- a/Lib/test/test__osx_support.py
+++ b/Lib/test/test__osx_support.py
@@ -174,6 +174,29 @@ class Test_OSXSupport(unittest.TestCase):
_osx_support._remove_universal_flags(
config_vars))
+ def test__remove_universal_flags_alternate(self):
+ # bpo-38360: also test the alternate single-argument form of -isysroot
+ config_vars = {
+ 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ',
+ 'LDFLAGS': '-arch ppc -arch i386 -g',
+ 'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.4u.sdk',
+ 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g',
+ 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 '
+ '-isysroot/Developer/SDKs/MacOSX10.4u.sdk -g',
+ }
+ expected_vars = {
+ 'CFLAGS': '-fno-strict-aliasing -g -O3 ',
+ 'LDFLAGS': ' -g',
+ 'CPPFLAGS': '-I. ',
+ 'BLDSHARED': 'gcc-4.0 -bundle -g',
+ 'LDSHARED': 'gcc-4.0 -bundle -g',
+ }
+ self.add_expected_saved_initial_values(config_vars, expected_vars)
+
+ self.assertEqual(expected_vars,
+ _osx_support._remove_universal_flags(
+ config_vars))
+
def test__remove_unsupported_archs(self):
config_vars = {
'CC': 'clang',
@@ -261,6 +284,34 @@ class Test_OSXSupport(unittest.TestCase):
_osx_support._check_for_unavailable_sdk(
config_vars))
+ def test__check_for_unavailable_sdk_alternate(self):
+ # bpo-38360: also test the alternate single-argument form of -isysroot
+ config_vars = {
+ 'CC': 'clang',
+ 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 '
+ '-isysroot/Developer/SDKs/MacOSX10.1.sdk',
+ 'LDFLAGS': '-arch ppc -arch i386 -g',
+ 'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.1.sdk',
+ 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g',
+ 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 '
+ '-isysroot/Developer/SDKs/MacOSX10.1.sdk -g',
+ }
+ expected_vars = {
+ 'CC': 'clang',
+ 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 '
+ ' ',
+ 'LDFLAGS': '-arch ppc -arch i386 -g',
+ 'CPPFLAGS': '-I. ',
+ 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g',
+ 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 '
+ ' -g',
+ }
+ self.add_expected_saved_initial_values(config_vars, expected_vars)
+
+ self.assertEqual(expected_vars,
+ _osx_support._check_for_unavailable_sdk(
+ config_vars))
+
def test_get_platform_osx(self):
# Note, get_platform_osx is currently tested more extensively
# indirectly by test_sysconfig and test_distutils