]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: skipping relative paths on go test -i ./...
authorFrancisco Souza <franciscossouza@gmail.com>
Wed, 15 Aug 2012 14:32:49 +0000 (07:32 -0700)
committerRob Pike <r@golang.org>
Wed, 15 Aug 2012 14:32:49 +0000 (07:32 -0700)
Fixes #3896.

R=rsc, rogpeppe, r
CC=golang-dev
https://golang.org/cl/6457075

src/cmd/go/test.bash
src/cmd/go/test.go

index fe186d4bbcb15c235b6838973d6da42a00f4cbb3..587bcfc1f96f7d0207b7abd4c3f8eb01b2b03279 100755 (executable)
@@ -76,6 +76,12 @@ if ! ./testgo test ./testdata/testimport; then
        ok=false
 fi
 
+# Test installation with relative imports.
+if ! ./testgo test -i ./testdata/testimport; then
+    echo "go test -i ./testdata/testimport failed"
+    ok=false
+fi
+
 # Test tests with relative imports in packages synthesized
 # from Go files named on the command line.
 if ! ./testgo test ./testdata/testimport/*.go; then
index 5f40bd64c03a4f5f52bd9938904e48f344d6af23..cd9b411e9d208f98aa02165764098d6138204dc4 100644 (file)
@@ -276,7 +276,9 @@ func runTest(cmd *Command, args []string) {
 
                all := []string{}
                for path := range deps {
-                       all = append(all, path)
+                       if !build.IsLocalImport(path) {
+                               all = append(all, path)
+                       }
                }
                sort.Strings(all)