diff options
| author | Alex Brainman <alex.brainman@gmail.com> | 2015-06-05 11:37:00 +1000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2015-06-08 15:14:39 +0000 |
| commit | a58e731287d28e25eae0fdfed9090f62222923cf (patch) | |
| tree | a909475517b15091dfbd8f2f135a0fd783076d12 /src | |
| parent | b0532a96a850c6c93de2c414f5349562938f0f19 (diff) | |
| download | go-a58e731287d28e25eae0fdfed9090f62222923cf.tar.xz | |
cmd/vet: fix tests on windows
Add .exe to exectable name, so it can be executed on windows.
Use proper windows paths when searching vet output.
Replace Skip with Skipf.
Fixes build
Change-Id: Ife40d8f5ab9d7093ca61c50683a358d4d6a3ba34
Reviewed-on: https://go-review.googlesource.com/10742
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Patrick Mézard <patrick@mezard.eu>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/vet/vet_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/vet/vet_test.go b/src/cmd/vet/vet_test.go index 6c954638ab..00fcb02754 100644 --- a/src/cmd/vet/vet_test.go +++ b/src/cmd/vet/vet_test.go @@ -16,7 +16,7 @@ import ( const ( dataDir = "testdata" - binary = "testvet" + binary = "testvet.exe" ) // Run this shell script, but do it in Go so it can be run by "go test". @@ -28,12 +28,12 @@ func TestVet(t *testing.T) { switch runtime.GOOS { case "plan9", "windows": // Plan 9 and Windows systems can't be guaranteed to have Perl and so can't run errchk. - t.Skip("skipping test; no Perl on %q", runtime.GOOS) + t.Skipf("skipping test; no Perl on %q", runtime.GOOS) case "nacl": t.Skip("skipping test; no command execution on nacl") case "darwin": if strings.HasPrefix(runtime.GOARCH, "arm") { - t.Skip("skipping test; no command execution on darwin/%s", runtime.GOARCH) + t.Skipf("skipping test; no command execution on darwin/%s", runtime.GOARCH) } } @@ -109,10 +109,10 @@ func TestTags(t *testing.T) { t.Fatal(err) } // file1 has testtag and file2 has !testtag. - if !bytes.Contains(output, []byte("tagtest/file1.go")) { + if !bytes.Contains(output, []byte(filepath.Join("tagtest", "file1.go"))) { t.Error("file1 was excluded, should be included") } - if bytes.Contains(output, []byte("tagtest/file2.go")) { + if bytes.Contains(output, []byte(filepath.Join("tagtest", "file2.go"))) { t.Error("file2 was included, should be excluded") } } |
