-
Notifications
You must be signed in to change notification settings - Fork 283
Compare paths case insensitive #329 #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
39c493f
to
8b56e52
Compare
Codecov Report
@@ Coverage Diff @@
## master #386 +/- ##
==========================================
- Coverage 94.95% 94.92% -0.03%
==========================================
Files 19 19
Lines 2160 2189 +29
Branches 374 379 +5
==========================================
+ Hits 2051 2078 +27
Misses 50 50
- Partials 59 61 +2
Continue to review full report at Codecov.
|
Changed from HOME to cwd. |
8b56e52
to
138aea2
Compare
- If cwd exist uppercase and lowercase the pattern match is also done case insensitive.
138aea2
to
a49601d
Compare
gcovr/utils.py
Outdated
@@ -180,7 +180,12 @@ def __init__(self, regex, path_context=None): | |||
|
|||
class Filter(object): | |||
def __init__(self, pattern): | |||
self.pattern = re.compile(pattern) | |||
cwd = os.getcwd() | |||
is_fs_case_insensitive = os.path.exists(cwd.upper()) and os.path.exists(cwd.lower()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that using cwd is sensible. But there might be the case that cwd = '/'
on Unix, which would falsely suggest a case-insensitive file system. In principle arbitrary non-alphabetic paths are possible, and I'm not sure to which degree this should be handled.
I'd suggest just a check is_fs_case_insensitive = (cwd != '/') and ...
, ignoring other paths that are case-invariant because nearly all projects will use a sane folder layout in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've used os.path.sep instead of '/'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I could only test on linux.
@latk: AppVeyor hangs on master branch but the gcovr team has no access to the project. Please can you check this? |
Build should be fixed now |
If HOME directory is case insensitive the pattern match is also done case insensitive.
Test for exclude filter adapted to give filename with wrong case if testcase.exe exists in filesystem.