[Python-checkins] r71525 - in python/branches/py3k: Lib/distutils/command/config.py Lib/distutils/tests/test_config_cmd.py
tarek.ziade
python-checkins at python.org
Sun Apr 12 18:34:34 CEST 2009
Author: tarek.ziade
Date: Sun Apr 12 18:34:34 2009
New Revision: 71525
Log:
Merged revisions 71523 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71523 | tarek.ziade | 2009-04-12 18:31:24 +0200 (Sun, 12 Apr 2009) | 1 line
added a simple test for search_cpp
........
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Lib/distutils/command/config.py
python/branches/py3k/Lib/distutils/tests/test_config_cmd.py
Modified: python/branches/py3k/Lib/distutils/command/config.py
==============================================================================
--- python/branches/py3k/Lib/distutils/command/config.py (original)
+++ python/branches/py3k/Lib/distutils/command/config.py Sun Apr 12 18:34:34 2009
@@ -198,9 +198,8 @@
preprocesses an empty file -- which can be useful to determine the
symbols the preprocessor and compiler set by default.
"""
-
self._check_compiler()
- (src, out) = self._preprocess(body, headers, include_dirs, lang)
+ src, out = self._preprocess(body, headers, include_dirs, lang)
if isinstance(pattern, str):
pattern = re.compile(pattern)
Modified: python/branches/py3k/Lib/distutils/tests/test_config_cmd.py
==============================================================================
--- python/branches/py3k/Lib/distutils/tests/test_config_cmd.py (original)
+++ python/branches/py3k/Lib/distutils/tests/test_config_cmd.py Sun Apr 12 18:34:34 2009
@@ -2,7 +2,7 @@
import unittest
import os
-from distutils.command.config import dump_file
+from distutils.command.config import dump_file, config
from distutils.tests import support
from distutils import log
@@ -10,7 +10,7 @@
support.TempdirManager,
unittest.TestCase):
- def _info(self, msg):
+ def _info(self, msg, *args):
for line in msg.splitlines():
self._logs.append(line)
@@ -35,6 +35,17 @@
dump_file(this_file, 'I am the header')
self.assertEquals(len(self._logs), numlines+1)
+ def test_search_cpp(self):
+ pkg_dir, dist = self.create_dist()
+ cmd = config(dist)
+
+ # simple pattern searches
+ match = cmd.search_cpp(pattern='xxx', body='// xxx')
+ self.assertEquals(match, 0)
+
+ match = cmd.search_cpp(pattern='command', body='// xxx')
+ self.assertEquals(match, 1)
+
def test_suite():
return unittest.makeSuite(ConfigTestCase)
More information about the Python-checkins
mailing list