Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
343e5f79
Commit
343e5f79
authored
Apr 12, 2009
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a simple test for search_cpp
parent
a3a55aca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
command/config.py
command/config.py
+2
-3
tests/test_config_cmd.py
tests/test_config_cmd.py
+13
-2
No files found.
command/config.py
View file @
343e5f79
...
@@ -202,11 +202,10 @@ class config(Command):
...
@@ -202,11 +202,10 @@ class config(Command):
preprocesses an empty file -- which can be useful to determine the
preprocesses an empty file -- which can be useful to determine the
symbols the preprocessor and compiler set by default.
symbols the preprocessor and compiler set by default.
"""
"""
self
.
_check_compiler
()
self
.
_check_compiler
()
(
src
,
out
)
=
self
.
_preprocess
(
body
,
headers
,
include_dirs
,
lang
)
src
,
out
=
self
.
_preprocess
(
body
,
headers
,
include_dirs
,
lang
)
if
type
(
pattern
)
is
StringType
:
if
isinstance
(
pattern
,
str
)
:
pattern
=
re
.
compile
(
pattern
)
pattern
=
re
.
compile
(
pattern
)
file
=
open
(
out
)
file
=
open
(
out
)
...
...
tests/test_config_cmd.py
View file @
343e5f79
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
unittest
import
unittest
import
os
import
os
from
distutils.command.config
import
dump_file
from
distutils.command.config
import
dump_file
,
config
from
distutils.tests
import
support
from
distutils.tests
import
support
from
distutils
import
log
from
distutils
import
log
...
@@ -10,7 +10,7 @@ class ConfigTestCase(support.LoggingSilencer,
...
@@ -10,7 +10,7 @@ class ConfigTestCase(support.LoggingSilencer,
support
.
TempdirManager
,
support
.
TempdirManager
,
unittest
.
TestCase
):
unittest
.
TestCase
):
def
_info
(
self
,
msg
):
def
_info
(
self
,
msg
,
*
args
):
for
line
in
msg
.
splitlines
():
for
line
in
msg
.
splitlines
():
self
.
_logs
.
append
(
line
)
self
.
_logs
.
append
(
line
)
...
@@ -35,6 +35,17 @@ class ConfigTestCase(support.LoggingSilencer,
...
@@ -35,6 +35,17 @@ class ConfigTestCase(support.LoggingSilencer,
dump_file
(
this_file
,
'I am the header'
)
dump_file
(
this_file
,
'I am the header'
)
self
.
assertEquals
(
len
(
self
.
_logs
),
numlines
+
1
)
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
():
def
test_suite
():
return
unittest
.
makeSuite
(
ConfigTestCase
)
return
unittest
.
makeSuite
(
ConfigTestCase
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment