Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Attributes
distutils.tests.test_unixccompiler.UnixCCompilerTestCase Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_runtime_libdir_option

Public Attributes

 cc

Private Attributes

 _backup_platform
 _backup_get_config_var

Detailed Description

Definition at line 9 of file test_unixccompiler.py.


Member Function Documentation

Definition at line 11 of file test_unixccompiler.py.

00011 
00012     def setUp(self):
00013         self._backup_platform = sys.platform
00014         self._backup_get_config_var = sysconfig.get_config_var
00015         class CompilerWrapper(UnixCCompiler):
00016             def rpath_foo(self):
00017                 return self.runtime_library_dir_option('/foo')
00018         self.cc = CompilerWrapper()

Here is the caller graph for this function:

Definition at line 19 of file test_unixccompiler.py.

00019 
00020     def tearDown(self):
00021         sys.platform = self._backup_platform
00022         sysconfig.get_config_var = self._backup_get_config_var

Here is the caller graph for this function:

Definition at line 23 of file test_unixccompiler.py.

00023 
00024     def test_runtime_libdir_option(self):
00025 
00026         # not tested under windows
00027         if sys.platform == 'win32':
00028             return
00029 
00030         # Issue#5900
00031         #
00032         # Ensure RUNPATH is added to extension modules with RPATH if
00033         # GNU ld is used
00034 
00035         # darwin
00036         sys.platform = 'darwin'
00037         self.assertEqual(self.cc.rpath_foo(), '-L/foo')
00038 
00039         # hp-ux
00040         sys.platform = 'hp-ux'
00041         old_gcv = sysconfig.get_config_var
00042         def gcv(v):
00043             return 'xxx'
00044         sysconfig.get_config_var = gcv
00045         self.assertEqual(self.cc.rpath_foo(), ['+s', '-L/foo'])
00046 
00047         def gcv(v):
00048             return 'gcc'
00049         sysconfig.get_config_var = gcv
00050         self.assertEqual(self.cc.rpath_foo(), ['-Wl,+s', '-L/foo'])
00051 
00052         def gcv(v):
00053             return 'g++'
00054         sysconfig.get_config_var = gcv
00055         self.assertEqual(self.cc.rpath_foo(), ['-Wl,+s', '-L/foo'])
00056 
00057         sysconfig.get_config_var = old_gcv
00058 
00059         # irix646
00060         sys.platform = 'irix646'
00061         self.assertEqual(self.cc.rpath_foo(), ['-rpath', '/foo'])
00062 
00063         # osf1V5
00064         sys.platform = 'osf1V5'
00065         self.assertEqual(self.cc.rpath_foo(), ['-rpath', '/foo'])
00066 
00067         # GCC GNULD
00068         sys.platform = 'bar'
00069         def gcv(v):
00070             if v == 'CC':
00071                 return 'gcc'
00072             elif v == 'GNULD':
00073                 return 'yes'
00074         sysconfig.get_config_var = gcv
00075         self.assertEqual(self.cc.rpath_foo(), '-Wl,--enable-new-dtags,-R/foo')
00076 
00077         # GCC non-GNULD
00078         sys.platform = 'bar'
00079         def gcv(v):
00080             if v == 'CC':
00081                 return 'gcc'
00082             elif v == 'GNULD':
00083                 return 'no'
00084         sysconfig.get_config_var = gcv
00085         self.assertEqual(self.cc.rpath_foo(), '-Wl,-R/foo')
00086 
00087         # GCC GNULD with fully qualified configuration prefix
00088         # see #7617
00089         sys.platform = 'bar'
00090         def gcv(v):
00091             if v == 'CC':
00092                 return 'x86_64-pc-linux-gnu-gcc-4.4.2'
00093             elif v == 'GNULD':
00094                 return 'yes'
00095         sysconfig.get_config_var = gcv
00096         self.assertEqual(self.cc.rpath_foo(), '-Wl,--enable-new-dtags,-R/foo')
00097 
00098 
00099         # non-GCC GNULD
00100         sys.platform = 'bar'
00101         def gcv(v):
00102             if v == 'CC':
00103                 return 'cc'
00104             elif v == 'GNULD':
00105                 return 'yes'
00106         sysconfig.get_config_var = gcv
00107         self.assertEqual(self.cc.rpath_foo(), '-R/foo')
00108 
00109         # non-GCC non-GNULD
00110         sys.platform = 'bar'
00111         def gcv(v):
00112             if v == 'CC':
00113                 return 'cc'
00114             elif v == 'GNULD':
00115                 return 'no'
00116         sysconfig.get_config_var = gcv
00117         self.assertEqual(self.cc.rpath_foo(), '-R/foo')

Here is the call graph for this function:


Member Data Documentation

Definition at line 13 of file test_unixccompiler.py.

Definition at line 12 of file test_unixccompiler.py.

Definition at line 17 of file test_unixccompiler.py.


The documentation for this class was generated from the following file: