-
Notifications
You must be signed in to change notification settings - Fork 282
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
Fix pr#2053 for native Windows builds #2058
Fix pr#2053 for native Windows builds #2058
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2058 +/- ##
==========================================
- Coverage 61.48% 5.72% -55.77%
==========================================
Files 96 96
Lines 19207 18955 -252
Branches 9843 9843
==========================================
- Hits 11810 1085 -10725
- Misses 5080 17682 +12602
+ Partials 2317 188 -2129
Continue to review full report at Codecov.
|
For future reference: this is a relatively new test, added in #2053. |
@postscript-dev: it looks like this test never caused a problem in our automated Windows tests. Do you have any idea what's different about the automated tests that stopped them from being affected? |
Sorry, I don't know. I use MSYS2/MinGW64 and the output uses Windows newlines. The temp file is: |
The only interesting thing I found on MSYS2/MinGW64 was that when using `diff`, the different newline characters were ignored by default. I didn't need the additional parameter but added it for compatibility with Linux/macOS.
|
I was wondering if this could be caused by git auto-converting the line endings when you check the code out. Which file has the Windows line endings: |
@postscript-dev I'm surprised you're executing diff/cmp. The usual workflow in the test suite is to store the "reference output" in the script (in the |
@kevinbackhouse: Sorry for the delay. In MSYS2/MinGW64, I deleted the I don't have Visual Studio installed but in Windows 11, I installed Python3 and downloaded the latest official Windows nightly build (exiv2-1.0.0.9-2019msvc64.zip). When I ran tests\bugfixes\github\test_issue_1959.py, this behaved the same as the MSYS2/MinGW version. Both @clanmills: You are right about using the Python compare and I did consider that method. As I included a lot of tags in the file, the output is quite long and I was unsure about adding that much text to a Python test. Your comment about not having |
@postscript-dev I think you should leave the test framework to do the comparison for you. If the "reference output" is really long, you can probably read it into the test suite. Typical test code is: stdin = [ "dkdkdkdkd", "kekeke010101" ]
stderr = [ "", "" ] Instead of having huge strings in the python code, you could read them from a file. Something like this (take care, my python's rusty and probably wrong) but you get the idea: stderr = [ "", "" ]
stdin = [ "", "" ]
stdin[0] = open('reference_1234_0.txt', 'rb').read()
stdin[1] = open('reference_1234_1.txt', 'rb').read() There are variables set from tests/suite.conf to identify directories. For example: |
@clanmills: Thanks for explaining, I will change the test over to use the Python framework instead. This will be a job for next week sometime. |
Both Windows and Linux/macOS use different newline characters in output. In native Windows builds, Python test fails when using `cmp` to compare files. Use `diff --strip-trailing-cr` instead. The Windows CI builds were unaffected by the problem.
Removes dependency on command line tools being available.
ac881f6
to
058b33b
Compare
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! Thanks!
Fixes: