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)
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
support.TempdirManager,
unittest.TestCase):
- def _info(self, msg):
+ def _info(self, msg, *args):
for line in msg.splitlines():
self._logs.append(line)
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)