Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
26c706f2
Commit
26c706f2
authored
Jan 13, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid use of grep, ls on Windows
parent
f2360777
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
tests/build/common_include_dir.srctree
tests/build/common_include_dir.srctree
+26
-4
No files found.
tests/build/common_include_dir.srctree
View file @
26c706f2
...
...
@@ -2,12 +2,14 @@ PYTHON setup.py build_ext --inplace
PYTHON -c "import runner"
# Verify some files were created.
ls common/AddTraceback_impl*.h common/RaiseException_impl_*.h
# ls common/AddTraceback_impl*.h common/RaiseException_impl_*.h
PYTHON -c "import glob; assert glob.glob('common/AddTraceback_impl*.h')"
PYTHON -c "import glob; assert glob.glob('common/RaiseException_impl_*.h')"
# Verify that they're used.
grep
-c '#include "common/AddTraceback_impl_.*h"' a.c
grep
-c '#include "common/AddTraceback_impl_.*h"' b.c
grep
-c '#include "common/AddTraceback_impl_.*h"' c.c
PYTHON fake_grep.py
-c '#include "common/AddTraceback_impl_.*h"' a.c
PYTHON fake_grep.py
-c '#include "common/AddTraceback_impl_.*h"' b.c
PYTHON fake_grep.py
-c '#include "common/AddTraceback_impl_.*h"' c.c
######## setup.py ########
...
...
@@ -56,3 +58,23 @@ if __name__ == "__main__":
######## runner.py ########
import a, b, c
######## fake_grep.py ########
import platform
import re
import sys
if platform == 'Windows':
opt, pattern, file = sys.argv[1:]
assert opt == '-c'
count = 0
regex = re.compile(pattern)
for line in open(file):
if regex.search(line):
count += 1
print count
sys.exit(count == 0)
else:
import subprocess
sys.exit(subprocess.call(['grep'] + sys.argv[1:]))
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