diff options
author | doko@ubuntu.com <doko@ubuntu.com> | 2015-04-15 18:23:14 (GMT) |
---|---|---|
committer | doko@ubuntu.com <doko@ubuntu.com> | 2015-04-15 18:23:14 (GMT) |
commit | d3899c1a962f4f06f52199d1e5e4b921843e587b (patch) | |
tree | 4e5ecaa46fda3b224516a58f7c639239a5cba2af /Lib/test/test_sysconfig.py | |
parent | 7a80389ce5b2687137884e423d3bda27ff5d3acc (diff) | |
download | cpython-d3899c1a962f4f06f52199d1e5e4b921843e587b.zip cpython-d3899c1a962f4f06f52199d1e5e4b921843e587b.tar.gz cpython-d3899c1a962f4f06f52199d1e5e4b921843e587b.tar.bz2 |
- Issue #22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include
the architecture triplet in the extension name, to make it easy to test builds
for different ABIs in the same working tree.
Diffstat (limited to 'Lib/test/test_sysconfig.py')
-rw-r--r-- | Lib/test/test_sysconfig.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 3711784..0d915b1 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -390,10 +390,19 @@ class TestSysConfig(unittest.TestCase): self.assertEqual(vars['SO'], vars['EXT_SUFFIX']) @unittest.skipUnless(sys.platform == 'linux', 'Linux-specific test') - def test_bitness_in_ext_suffix(self): + def test_triplet_in_ext_suffix(self): + import ctypes, platform, re + machine = platform.machine() suffix = sysconfig.get_config_var('EXT_SUFFIX') - bitness = '-32b' if sys.maxsize < 2**32 else '-64b' - self.assertTrue(suffix.endswith(bitness + '.so'), 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)$', 'x86_64'): + 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) class MakefileTests(unittest.TestCase): |