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

Side by Side Diff: Lib/distutils/tests/test_config_cmd.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 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:
View unified diff | Download patch
« no previous file with comments | « Lib/distutils/tests/test_build_py.py ('k') | Lib/distutils/tests/test_cygwinccompiler.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """Tests for distutils.command.config.""" 1 """Tests for distutils.command.config."""
2 import unittest 2 import unittest
3 import os 3 import os
4 import sys 4 import sys
5 from test.support import run_unittest 5 from test.support import run_unittest
6 6
7 from distutils.command.config import dump_file, config 7 from distutils.command.config import dump_file, config
8 from distutils.tests import support 8 from distutils.tests import support
9 from distutils import log 9 from distutils import log
10 10
(...skipping 20 matching lines...) Expand all
31 f = open(this_file) 31 f = open(this_file)
32 try: 32 try:
33 numlines = len(f.readlines()) 33 numlines = len(f.readlines())
34 finally: 34 finally:
35 f.close() 35 f.close()
36 36
37 dump_file(this_file, 'I am the header') 37 dump_file(this_file, 'I am the header')
38 self.assertEqual(len(self._logs), numlines+1) 38 self.assertEqual(len(self._logs), numlines+1)
39 39
40 @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") 40 @unittest.skipIf(sys.platform == 'win32', "can't test on Windows")
41 @unittest.skipUnless(hasattr(os, 'fork'), "distutils cannot spawn child proc esses")
41 def test_search_cpp(self): 42 def test_search_cpp(self):
42 pkg_dir, dist = self.create_dist() 43 pkg_dir, dist = self.create_dist()
43 cmd = config(dist) 44 cmd = config(dist)
44 45
45 # simple pattern searches 46 # simple pattern searches
46 match = cmd.search_cpp(pattern='xxx', body='/* xxx */') 47 match = cmd.search_cpp(pattern='xxx', body='/* xxx */')
47 self.assertEqual(match, 0) 48 self.assertEqual(match, 0)
48 49
49 match = cmd.search_cpp(pattern='_configtest', body='/* xxx */') 50 match = cmd.search_cpp(pattern='_configtest', body='/* xxx */')
50 self.assertEqual(match, 1) 51 self.assertEqual(match, 1)
(...skipping 29 matching lines...) Expand all
80 cmd._clean(f1, f2) 81 cmd._clean(f1, f2)
81 82
82 for f in (f1, f2): 83 for f in (f1, f2):
83 self.assertFalse(os.path.exists(f)) 84 self.assertFalse(os.path.exists(f))
84 85
85 def test_suite(): 86 def test_suite():
86 return unittest.makeSuite(ConfigTestCase) 87 return unittest.makeSuite(ConfigTestCase)
87 88
88 if __name__ == "__main__": 89 if __name__ == "__main__":
89 run_unittest(test_suite()) 90 run_unittest(test_suite())
OLDNEW
« no previous file with comments | « Lib/distutils/tests/test_build_py.py ('k') | Lib/distutils/tests/test_cygwinccompiler.py » ('j') | no next file with comments »

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