Skip to content
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

Gcovr does not handle "Could not open output file" error message. #243

Closed
MartinXMraz opened this issue Mar 11, 2018 · 7 comments
Closed

Gcovr does not handle "Could not open output file" error message. #243

MartinXMraz opened this issue Mar 11, 2018 · 7 comments

Comments

@MartinXMraz
Copy link
Contributor

@MartinXMraz MartinXMraz commented Mar 11, 2018

#Gcov produces error message "Could not open output file" in e.g. case it tries to create temporary *.c.gcov file beyond 259 chars limitation on Windows (or path+name will exceed this limitation), but gcovr does not handle this type of error message. Therefore the gcovr continues and does not create report for this file.
Gcovr handles correctly error message "Cannot open source file" comming from gcov, but not error message "Could not open output file".

@latk
Copy link
Member

@latk latk commented Mar 11, 2018

You are right, we can add that check to that output. Thank you for pointing this out!

If you have a sufficiently modern GCC (version 6 or later), you can also force gcov to limit the length of filenames with the gcov -x option. To do so, provide a custom gcov executable to gcovr with --gcov-executable='gcov -x', or by setting the environment variable GCOV='gcov -x'. (I haven't tested this.)

Similar issues have cropped up a couple of times in the past. May I ask which operating system and possibly which file system you are using?

@latk
Copy link
Member

@latk latk commented Mar 11, 2018

Might be related to #88 (macOS) or #7 (Windows)

@MartinXMraz
Copy link
Contributor Author

@MartinXMraz MartinXMraz commented Mar 11, 2018

I am using Windows 7 with NTFS file system.

@MartinXMraz
Copy link
Contributor Author

@MartinXMraz MartinXMraz commented Mar 11, 2018

Small fix of this issue works fine on my system. I replaced line 20 in gcov.py "source_re = re.compile("[Cc]annot open (source|graph) file")" with line "source_re = re.compile("[Cc][annot|ould not] open (source|graph|output) file")". But I`ve not tested this on any other system but mine.

@latk
Copy link
Member

@latk latk commented Mar 11, 2018

Looks good to me. That shouldn't break anything. Want to open a pull request?

Please let me know if I can assist with that in any way.

@MartinXMraz
Copy link
Contributor Author

@MartinXMraz MartinXMraz commented Mar 11, 2018

Opening a pull request means that the change will be pushed to repo? It sounds good, but since I am new here, maybe you can push this change to repo instead.

@latk
Copy link
Member

@latk latk commented Mar 11, 2018

If you're interested, I can walk you through the process. Want to join me in a chatroom (https://gitter.im/gcovr/gcovr)? If not, that's also fine and I'll fix this sometime next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants