Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test.vim: more efficient compiling of test files
This change improves the way we compile a Go test. Previously we would build a test binary to catch any build errors. A callback was then responsible to delete the test binary after showing build errors (if there were any). This could be racy though, because if the tests lasts long and we quit early, the callback to clean the binary file would never run. So we would end up with artifacts in our working directory. To fix the issue we're going to tell to the `go` tool to run a specific, unique function. We're passing a unique identifier as a function name (which is a randomly generated). This will cause the go tool to build the test file and then try to run the test function. Because there is no such test function, it'll silently quit with zero exit status. As a side effect it'll compile the test file, so we're able to catch any build errors (if any) fixes #907
- Loading branch information