From fd39b7aa6ea9b9f56cd438a9262bf6e822d0161c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarek=20Ziad=C3=A9?= Date: Sun, 12 Apr 2009 16:34:34 +0000 Subject: 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 ........ --- Lib/distutils/command/config.py | 3 +-- Lib/distutils/tests/test_config_cmd.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Lib/distutils/command/config.py b/Lib/distutils/command/config.py index 385a47a..c312205 100644 --- a/Lib/distutils/command/config.py +++ b/Lib/distutils/command/config.py @@ -198,9 +198,8 @@ class config(Command): 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) diff --git a/Lib/distutils/tests/test_config_cmd.py b/Lib/distutils/tests/test_config_cmd.py index 6fd1776..af16d4c 100644 --- a/Lib/distutils/tests/test_config_cmd.py +++ b/Lib/distutils/tests/test_config_cmd.py @@ -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 @@ class ConfigTestCase(support.LoggingSilencer, 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 @@ class ConfigTestCase(support.LoggingSilencer, 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) -- cgit v0.12