-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
do not try to run tests for :GoTestCompile #1519
Conversation
What happens to testfile? The change previously wouldn't create any binary. Imho if we decide to get rid of it (due the problem outlined in #1515) we should also delete the created |
As it stands right now, the OS will clean up the file if/when it needs to, and Vim will also clean it up when Vim exits, but I can add back the callbacks to try to clean it up after the FWIW, I vascillated on whether to delete it or not, because it won't for sure get deleted for the reasons outlined in |
I'm not sure how Vim deletes it if we quit it. Can you show the source code in vim-go (if it's done here) or the doc in Vim for it? I believe the binary will be still in CWD. |
177daa2
to
28250d1
Compare
Yeah, sorry about that; I had made some changes, then altered those just a bit to verify the file location, and then I only undid a portion of the debugging changes, which resulted in a commit that wasn't what I originally intended. I've amended the commit to show what I'd originally intended to submit. As you can see, the filename comes from Let me know if you still want to proactively delete the file. |
autoload/go/test.vim
Outdated
" we're going to tell to run a test function that doesn't exist. This | ||
" triggers a build of the test file itself but no tests will run. | ||
call extend(args, ["-run", "499EE4A2-5C85-4D35-98FC-7377CD87F263"]) | ||
let testfile = tempname(). ".test" |
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.
can you change this to .vim-go.test
. At least it wouldn't be a surprise for some if they somehow delve /tmp and see tens of these files
lgtm, just a small comment. |
Do not try to run a non-existent test for :GoTestCompile. Instead, compile tests to a temporary file with `go test -c` in order to avoid problems that may be caused by runtime errors in an init function when trying to run a non-existent test. To avoid the problems that 21376e6 resolved, this change relies on Vim's managing of the temporary directory instead.
28250d1
to
b2ffdaa
Compare
Do not try to run a non-existent test for :GoTestCompile. Instead,
compile tests to a temporary file with
go test -c
in order to avoidproblems that may be caused by runtime errors in an init function when
trying to run a non-existent test.
To avoid the problems that 21376e6
resolved, this change relies on Vim's managing of the temporary
directory instead.
Fixes #1515