summaryrefslogtreecommitdiff
path: root/Lib/test/test_sysconfig.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-06 14:14:49 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-06 14:14:49 +0300
commit986142fb151e4113f92b7b1979d65301ef028176 (patch)
tree8c80f0e83be3d94909f3f5579c12f02e1f4ab9e1 /Lib/test/test_sysconfig.py
parent4581daf13ff43a8392614c5199e8cf3f4aa08ada (diff)
parent49f16468feeeb6972bfc6a31c4ce92d6cce30ee9 (diff)
downloadcpython-986142fb151e4113f92b7b1979d65301ef028176.tar.gz
Use support.change_cwd() in tests.
Diffstat (limited to 'Lib/test/test_sysconfig.py')
-rw-r--r--Lib/test/test_sysconfig.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 8ed729a2b5..0917c3e260 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -385,6 +385,25 @@ class TestSysConfig(unittest.TestCase):
self.assertIsNotNone(vars['SO'])
self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])
+ @unittest.skipUnless(sys.platform == 'linux', 'Linux-specific test')
+ def test_triplet_in_ext_suffix(self):
+ import ctypes, platform, re
+ machine = platform.machine()
+ suffix = sysconfig.get_config_var('EXT_SUFFIX')
+ if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine):
+ self.assertTrue('linux' in suffix, suffix)
+ if re.match('(i[3-6]86|x86_64)$', machine):
+ if ctypes.sizeof(ctypes.c_char_p()) == 4:
+ self.assertTrue(suffix.endswith('i386-linux-gnu.so') \
+ or suffix.endswith('x86_64-linux-gnux32.so'),
+ suffix)
+ else: # 8 byte pointer size
+ self.assertTrue(suffix.endswith('x86_64-linux-gnu.so'), suffix)
+
+ @unittest.skipUnless(sys.platform == 'darwin', 'OS X-specific test')
+ def test_osx_ext_suffix(self):
+ suffix = sysconfig.get_config_var('EXT_SUFFIX')
+ self.assertTrue(suffix.endswith('-darwin.so'), suffix)
class MakefileTests(unittest.TestCase):