cmd/go: check for 'svn' binary in PATH in TestAccidentalGitCheckout

This test requires subversion to run, but does not check to see if it's
available before running as it does for git.

Call testenv.MustHaveExecPath to check beforehand to allow the test to
be skipped if the svn binary does not exist.

Change-Id: I16ae104621b221fc6e96f6c7dcd71bf406caa0c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/223082
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
zikaeroh 2020-03-11 17:17:57 -07:00 committed by Bryan C. Mills
parent 9d67a94217
commit c6bcdeafd2

View File

@ -1044,6 +1044,7 @@ func TestGetGitDefaultBranch(t *testing.T) {
func TestAccidentalGitCheckout(t *testing.T) { func TestAccidentalGitCheckout(t *testing.T) {
testenv.MustHaveExternalNetwork(t) testenv.MustHaveExternalNetwork(t)
testenv.MustHaveExecPath(t, "git") testenv.MustHaveExecPath(t, "git")
testenv.MustHaveExecPath(t, "svn")
tg := testgo(t) tg := testgo(t)
defer tg.cleanup() defer tg.cleanup()