mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
x/tools: fix build
Change-Id: I02b42abcc29ee04c8f54dc8ba2c6079b3e6c4153 Reviewed-on: https://go-review.googlesource.com/18816 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
abfa4875c0
commit
d2e00652ba
@ -1,14 +0,0 @@
|
|||||||
// Copyright 2014 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// Incomplete source tree on Android.
|
|
||||||
|
|
||||||
// +build !android
|
|
||||||
// +build go1.6
|
|
||||||
|
|
||||||
package buildutil_test
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
go16 = true
|
|
||||||
}
|
|
@ -18,8 +18,6 @@ import (
|
|||||||
"golang.org/x/tools/go/buildutil"
|
"golang.org/x/tools/go/buildutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var go16 bool // Go version >= go1.6
|
|
||||||
|
|
||||||
func TestContainingPackage(t *testing.T) {
|
func TestContainingPackage(t *testing.T) {
|
||||||
// unvirtualized:
|
// unvirtualized:
|
||||||
goroot := runtime.GOROOT()
|
goroot := runtime.GOROOT()
|
||||||
@ -32,13 +30,6 @@ func TestContainingPackage(t *testing.T) {
|
|||||||
{gopath + "/src/golang.org/x/tools/go/buildutil/util_test.go",
|
{gopath + "/src/golang.org/x/tools/go/buildutil/util_test.go",
|
||||||
"golang.org/x/tools/go/buildutil"},
|
"golang.org/x/tools/go/buildutil"},
|
||||||
}
|
}
|
||||||
// TODO(adonovan): simplify after Go 1.6.
|
|
||||||
if go16 {
|
|
||||||
tests = append(tests, [2]string{
|
|
||||||
gopath + "/src/vendor/golang.org/x/net/http2/hpack/hpack.go",
|
|
||||||
"vendor/golang.org/x/net/http2/hpack",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
file, want := test[0], test[1]
|
file, want := test[0], test[1]
|
||||||
bp, err := buildutil.ContainingPackage(&build.Default, ".", file)
|
bp, err := buildutil.ContainingPackage(&build.Default, ".", file)
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
// Copyright 2015 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build !android
|
|
||||||
// +build go1.6
|
|
||||||
|
|
||||||
package importgraph_test
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
go16 = true
|
|
||||||
}
|
|
@ -9,10 +9,8 @@
|
|||||||
package importgraph_test
|
package importgraph_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"go/build"
|
"go/build"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"golang.org/x/tools/refactor/importgraph"
|
"golang.org/x/tools/refactor/importgraph"
|
||||||
@ -22,8 +20,6 @@ import (
|
|||||||
|
|
||||||
const this = "golang.org/x/tools/refactor/importgraph"
|
const this = "golang.org/x/tools/refactor/importgraph"
|
||||||
|
|
||||||
var go16 bool // Go version >= go1.6
|
|
||||||
|
|
||||||
func TestBuild(t *testing.T) {
|
func TestBuild(t *testing.T) {
|
||||||
forward, reverse, errors := importgraph.Build(&build.Default)
|
forward, reverse, errors := importgraph.Build(&build.Default)
|
||||||
|
|
||||||
@ -49,14 +45,6 @@ func TestBuild(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test vendor packages appear under their absolute names.
|
|
||||||
if go16 { // hack: Go 1.6+ only
|
|
||||||
if !forward["net/http"]["vendor/golang.org/x/net/http2/hpack"] {
|
|
||||||
t.Errorf("forward[net/http] does not include vendor/golang.org/x/net/http2/hpack: %v",
|
|
||||||
strings.Replace(fmt.Sprint(forward["net/http"]), ":true", "", -1))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test Search is reflexive.
|
// Test Search is reflexive.
|
||||||
if !forward.Search(this)[this] {
|
if !forward.Search(this)[this] {
|
||||||
t.Errorf("irreflexive: forward.Search(importgraph)[importgraph] not found")
|
t.Errorf("irreflexive: forward.Search(importgraph)[importgraph] not found")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user