Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(43141)

Delta Between Two Patch Sets: Lib/test/test_sysconfig.py

Issue 22980: C extension naming doesn't take bitness into account
Left Patch Set: Created 4 years, 5 months ago
Right Patch Set: Created 4 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « configure.ac ('k') | Misc/NEWS » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 import unittest 1 import unittest
2 import sys 2 import sys
3 import os 3 import os
4 import subprocess 4 import subprocess
5 import shutil 5 import shutil
6 from copy import copy 6 from copy import copy
7 7
8 from test.support import (run_unittest, TESTFN, unlink, check_warnings, 8 from test.support import (run_unittest, TESTFN, unlink, check_warnings,
9 captured_stdout, skip_unless_symlink) 9 captured_stdout, skip_unless_symlink)
10 10
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 self.assertEqual(sysconfig.get_config_var('SO'), 382 self.assertEqual(sysconfig.get_config_var('SO'),
383 sysconfig.get_config_var('EXT_SUFFIX')) 383 sysconfig.get_config_var('EXT_SUFFIX'))
384 384
385 @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None, 385 @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
386 'EXT_SUFFIX required for this test') 386 'EXT_SUFFIX required for this test')
387 def test_SO_in_vars(self): 387 def test_SO_in_vars(self):
388 vars = sysconfig.get_config_vars() 388 vars = sysconfig.get_config_vars()
389 self.assertIsNotNone(vars['SO']) 389 self.assertIsNotNone(vars['SO'])
390 self.assertEqual(vars['SO'], vars['EXT_SUFFIX']) 390 self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])
391 391
392 @unittest.skipUnless(sys.platform == 'linux', 'Linux-specific test')
393 def test_triplet_in_ext_suffix(self):
394 import ctypes, platform, re
395 machine = platform.machine()
396 suffix = sysconfig.get_config_var('EXT_SUFFIX')
397 if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine):
398 self.assertTrue('linux' in suffix, suffix)
399 if re.match('(i[3-6]86|x86_64)$', 'x86_64'):
400 if ctypes.sizeof(ctypes.c_char_p()) == 4:
401 self.assertTrue(suffix.endswith('i386-linux-gnu.so') \
402 or suffix.endswith('x86_64-linux-gnux32.so'),
403 suffix)
404 else: # 8 byte pointer size
405 self.assertTrue(suffix.endswith('x86_64-linux-gnu.so'), suffix)
406
392 407
393 class MakefileTests(unittest.TestCase): 408 class MakefileTests(unittest.TestCase):
394 409
395 @unittest.skipIf(sys.platform.startswith('win'), 410 @unittest.skipIf(sys.platform.startswith('win'),
396 'Test is not Windows compatible') 411 'Test is not Windows compatible')
397 def test_get_makefile_filename(self): 412 def test_get_makefile_filename(self):
398 makefile = sysconfig.get_makefile_filename() 413 makefile = sysconfig.get_makefile_filename()
399 self.assertTrue(os.path.isfile(makefile), makefile) 414 self.assertTrue(os.path.isfile(makefile), makefile)
400 415
401 def test_parse_makefile(self): 416 def test_parse_makefile(self):
(...skipping 12 matching lines...) Expand all
414 'var4': '$/invalid', 429 'var4': '$/invalid',
415 'var5': 'dollar$5', 430 'var5': 'dollar$5',
416 }) 431 })
417 432
418 433
419 def test_main(): 434 def test_main():
420 run_unittest(TestSysConfig, MakefileTests) 435 run_unittest(TestSysConfig, MakefileTests)
421 436
422 if __name__ == "__main__": 437 if __name__ == "__main__":
423 test_main() 438 test_main()
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+