summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2012-07-22 05:35:16 (GMT)
committerNed Deily <nad@acm.org>2012-07-22 05:35:16 (GMT)
commit1ef871969cd8b30a8f8d4e6cefab68366eb71745 (patch)
treefa8dc9ecabb24c941ddea5a3360897b12079730c
parent34fcafde168edf5ca0b8c76a732e8850d97ea00e (diff)
downloadcpython-1ef871969cd8b30a8f8d4e6cefab68366eb71745.zip
cpython-1ef871969cd8b30a8f8d4e6cefab68366eb71745.tar.gz
cpython-1ef871969cd8b30a8f8d4e6cefab68366eb71745.tar.bz2
Issue #15184: Fix test__remove_unsupported_archs failures on 10.6
by removing unwarranted assumptions that clang compiler chain cannot handle ppc (the driver passes off ppc compiles to gcc). Mock the behavior instead.
-rw-r--r--Lib/test/test__osx_support.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py
index 30fa177..fb159ec 100644
--- a/Lib/test/test__osx_support.py
+++ b/Lib/test/test__osx_support.py
@@ -173,7 +173,6 @@ class Test_OSXSupport(unittest.TestCase):
_osx_support._remove_universal_flags(
config_vars))
- @unittest.skipUnless(shutil.which('clang'),'test requires clang')
def test__remove_unsupported_archs(self):
config_vars = {
'CC': 'clang',
@@ -195,6 +194,15 @@ class Test_OSXSupport(unittest.TestCase):
}
self.add_expected_saved_initial_values(config_vars, expected_vars)
+ suffix = (':' + self.env['PATH']) if self.env['PATH'] else ''
+ self.env['PATH'] = os.path.abspath(self.temp_path_dir) + suffix
+ c_name = 'clang'
+ test.support.unlink(c_name)
+ self.addCleanup(test.support.unlink, c_name)
+ # exit status 255 means no PPC support in this compiler chain
+ with open(c_name, 'w') as f:
+ f.write("#!/bin/sh\nexit 255")
+ os.chmod(c_name, stat.S_IRWXU)
self.assertEqual(expected_vars,
_osx_support._remove_unsupported_archs(
config_vars))