diff options
Diffstat (limited to 'Lib/test/test_sysconfig.py')
-rw-r--r-- | Lib/test/test_sysconfig.py | 19 |
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): |