-
Notifications
You must be signed in to change notification settings - Fork 30
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
Try to make tests run on Windows #41
Conversation
Travis doesn't support Windows. |
@hustf, it seems that travis doesn't like tabs in the |
I´ll do that, and see if #48 is affected before and after. |
The first test (line 49) is not mean to be run if gunzip.exe is not present. But is there any point in keeping it around for other OS? It runs the standalone program gunzip.exe with command line options. On Windows, it could be identified using 'where.exe gunzip.exe', if it happens to be on PATH. Or we could use something like JULIA_HOME..\Git\Gunzip.exe. The .exe file was included with Julia until 0.4.0 rc4 and possibly a bit longer. Now, it's not included anymore. |
I think the package only uses the library, but the tests use the executable for verification? |
on 0.5, you should be able to run |
Thanks for the info about busybox. |
close(gzfile) | ||
close(raw_file) | ||
@test data == data4 | ||
end |
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.
Looks like a tab snuck in here...
There's a merge conflict, currently, so AppVeyor can't run. Can you rebase on master? |
kmsquire, thanks for input, tabs are replaced with spaces now.
|
A bunch of unrelated commits are now in here. Could you rebase again, check that your local branch only has your commits on top of the current master, then be sure to force push over your fork's branch? |
Tony, that´s right. Like the January 9 committs are now referred here. That´s an uninteded result of rebasing my fork master, then rebasing my brach fixDep. But I´m afraid I don´t know how to force push. It would be easier for me to delete this and start over with a new fork, unless you have the exact commands in front of you? |
push with the |
- Added Compat for 0.3.11, changed to 0.4 Union syntax line 75 - Revoked travis.yml; now with git config --global core.autocrlf input. - Added appveyor.yml; copy of Compat appveour replacing package name. - Removed two tests on Windows, shortened try..catch to intended error messages only. - Tab changes - Removed line end spaces
I guess that is it now....? Merge? |
@@ -91,7 +93,9 @@ try | |||
NEW = GZip.GZLIB_VERSION > "1.2.3.9" | |||
pos = position(gzfile) | |||
NEW && (pos2 = position(gzfile,true)) | |||
@test_throws ErrorException seek(gzfile, 100) # can't seek backwards on write | |||
try | |||
@test_throws ErrorException seek(gzfile, 100) # can't seek backwards on write |
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.
why is this in a try?
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.
It used to be in a large try block from line 29/31. Line 97 actually throws an error; the test checks that it throws the correct error. Without a try, the code execution would halt. Correct me if I'm wrong.
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.
@test_throws
shouldn't halt if the right type of exception gets thrown
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.
and try finally
without a catch
will also terminate on an error, just with the cleanup tasks performed
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.
When commenting out 'catch' line 96 and replacing 98 with 'println("l98") the result is:
julia> include("runtests.jl")
ERROR: LoadError: test failed: seek(gzfile,100) did not throw ErrorException
in expression: seek(gzfile,100)
in error at error.jl:21
while loading C:\Users\F\Documents\GitHub\GZip.jl\test\runtests.jl, in expression starting on line 97
This in Julia 0.4.6, Windows 10.
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.
so it didn't error at all, but it was supposed to. is this a bug or platform IO difference? I'm not sure.
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.
That is right, I did not notice that at first. But we see in other places that there are differences in the library.
@@ -91,7 +93,9 @@ try | |||
NEW = GZip.GZLIB_VERSION > "1.2.3.9" | |||
pos = position(gzfile) | |||
NEW && (pos2 = position(gzfile,true)) | |||
@test_throws ErrorException seek(gzfile, 100) # can't seek backwards on write | |||
try |
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.
still don't think this should be a try catch. it could be disabled on windows if it's broken there, but do we know why it's broken?
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 think only the error message is broken.
seek(gzfile, 100) returns true in all cases, whether the current position can be changed or not.
To test the behaviour on Windows, we could check that the position remains unchanged after running seek(gzfile,100) or seek(gzfile, 1000000)
A more thorough approach might be to actually throw an error in Windows too, around Gzip.jl:328.
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.
is it a different exception type on windows then? or no exception at all?
Simon, thanks, but appveyor was put in this PR and also merged separately while this was still open. I have rebased to make the history as clear as possible. There are many improvements which could be made here, but I believe in making short and uncomplicated pull requests (in cases like this, that is!). |
Windows tests have been working for a while now. |
This effort stranded on
Libz is planned to replace Gzip. This is submitted in case this is picked up again for some reason.