Lines Matching refs:self
19 def setUp(self):
20 super(SysconfigTestCase, self).setUp()
21 self.makefile = None
23 def tearDown(self):
24 if self.makefile is not None:
25 os.unlink(self.makefile)
26 self.cleanup_testfn()
27 super(SysconfigTestCase, self).tearDown()
29 def cleanup_testfn(self):
36 def test_get_config_h_filename(self):
38 self.assertTrue(os.path.isfile(config_h), config_h)
40 def test_get_python_lib(self):
42 #self.assertTrue(os.path.isdir(lib_dir), lib_dir)
44 self.assertNotEqual(sysconfig.get_python_lib(),
47 def test_get_config_vars(self):
49 self.assertIsInstance(cvars, dict)
50 self.assertTrue(cvars)
53 def test_srcdir(self):
57 self.assertTrue(os.path.isabs(srcdir), srcdir)
58 self.assertTrue(os.path.isdir(srcdir), srcdir)
64 self.assertTrue(os.path.exists(Python_h), Python_h)
67 self.assertTrue(os.path.exists(pyconfig_h), pyconfig_h)
69 self.assertTrue(os.path.exists(pyconfig_h_in), pyconfig_h_in)
71 self.assertEqual(
75 def test_srcdir_independent_of_cwd(self):
85 self.assertEqual(srcdir, srcdir2)
87 def customize_compiler(self):
92 def set_executables(self, **kw):
93 self.exes = kw
119 def test_customize_compiler(self):
133 comp = self.customize_compiler()
134 self.assertEqual(comp.exes['archiver'],
136 self.assertEqual(comp.exes['preprocessor'],
138 self.assertEqual(comp.exes['compiler'],
140 self.assertEqual(comp.exes['compiler_so'],
143 self.assertEqual(comp.exes['compiler_cxx'],
145 self.assertEqual(comp.exes['linker_exe'],
147 self.assertEqual(comp.exes['linker_so'],
150 self.assertEqual(comp.shared_lib_extension, 'sc_shutil_suffix')
162 comp = self.customize_compiler()
163 self.assertEqual(comp.exes['archiver'],
165 self.assertEqual(comp.exes['preprocessor'],
167 self.assertEqual(comp.exes['compiler'],
169 self.assertEqual(comp.exes['compiler_so'],
171 self.assertEqual(comp.exes['compiler_cxx'],
173 self.assertEqual(comp.exes['linker_exe'],
175 self.assertEqual(comp.exes['linker_so'],
177 self.assertEqual(comp.shared_lib_extension, 'sc_shutil_suffix')
179 def test_parse_makefile_base(self):
180 self.makefile = TESTFN
181 fd = open(self.makefile, 'w')
187 d = sysconfig.parse_makefile(self.makefile)
188 self.assertEqual(d, {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'",
191 def test_parse_makefile_literal_dollar(self):
192 self.makefile = TESTFN
193 fd = open(self.makefile, 'w')
199 d = sysconfig.parse_makefile(self.makefile)
200 self.assertEqual(d, {'CONFIG_ARGS': r"'--arg1=optarg1' 'ENV=\$LIB'",
204 def test_sysconfig_module(self):
206 self.assertEqual(global_sysconfig.get_config_var('CFLAGS'),
208 self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'),
213 def test_sysconfig_compiler_vars(self):
230 self.skipTest('compiler flags customized')
231 self.assertEqual(global_sysconfig.get_config_var('LDSHARED'),
233 self.assertEqual(global_sysconfig.get_config_var('CC'),
237 def test_customize_compiler_before_get_config_vars(self):
254 self.assertEqual(0, p.returncode, "Subprocess failed: " + outs)