x/tools: disable tests not supported on Android

For golang/go#11811.

Change-Id: Icf16a2d47fcf2fe0d79dd825ccb851a3d63a660f
Reviewed-on: https://go-review.googlesource.com/13268
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Robert Griesemer 2015-08-05 16:42:54 -07:00
parent 63f996ec75
commit 958ab4f550
22 changed files with 98 additions and 5 deletions

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// No testdata on Android.
// +build !android
package main_test
import (

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// No testdata on Android.
// +build !android
package main
import (

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// No testdata on Android.
// +build !android
package main_test
import (

View File

@ -2,6 +2,10 @@
// 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
package buildutil_test
import (

View File

@ -2,6 +2,10 @@
// 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
package buildutil_test
import (

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// No testdata on Android.
// +build !android
package cha_test
import (

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// No testdata on Android.
// +build !android
package rta_test
import (

View File

@ -100,6 +100,9 @@ var importerTests = [...]importerTest{
}
func TestGoxImporter(t *testing.T) {
if runtime.GOOS == "android" {
t.Skipf("no testdata directory on %s", runtime.GOOS)
}
initmap := make(map[*types.Package]InitData)
imp := GetImporter([]string{"testdata"}, initmap)

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// No testdata on Android.
// +build !android
package loader_test
import (

View File

@ -29,6 +29,10 @@ import (
)
func TestStdlib(t *testing.T) {
if runtime.GOOS == "android" {
t.Skipf("incomplete std lib on %s", runtime.GOOS)
}
runtime.GC()
t0 := time.Now()
var memstats runtime.MemStats
@ -115,9 +119,10 @@ func TestStdlib(t *testing.T) {
func TestCgoOption(t *testing.T) {
switch runtime.GOOS {
// On these systems, the net and os/user packages don't use cgo.
case "plan9", "solaris", "windows":
return
// On these systems, the net and os/user packages don't use cgo
// or the std library is incomplete (Android).
case "android", "plan9", "solaris", "windows":
t.Skipf("no cgo or incomplete std lib on %s", runtime.GOOS)
}
// In nocgo builds (e.g. linux-amd64-nocgo),
// there is no "runtime/cgo" package,

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// No testdata on Android.
// +build !android
package pointer_test
// This test uses 'expectation' comments embedded within testdata/*.go

View File

@ -2,6 +2,10 @@
// 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
package pointer
// This file runs the pointer analysis on all packages and tests beneath

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !windows,!plan9
// +build !android,!windows,!plan9
package interp_test

View File

@ -13,6 +13,7 @@ import (
"go/token"
"os"
"regexp"
"runtime"
"strings"
"testing"
@ -25,6 +26,10 @@ import (
)
func TestObjValueLookup(t *testing.T) {
if runtime.GOOS == "android" {
t.Skipf("no testdata directory on %s", runtime.GOOS)
}
conf := loader.Config{ParserMode: parser.ParseComments}
f, err := conf.ParseFile("testdata/objlookup.go", nil)
if err != nil {
@ -189,6 +194,10 @@ func checkVarValue(t *testing.T, prog *ssa.Program, pkg *ssa.Package, ref []ast.
// Ensure that, in debug mode, we can determine the ssa.Value
// corresponding to every ast.Expr.
func TestValueForExpr(t *testing.T) {
if runtime.GOOS == "android" {
t.Skipf("no testdata dir on %s", runtime.GOOS)
}
conf := loader.Config{ParserMode: parser.ParseComments}
f, err := conf.ParseFile("testdata/valueforexpr.go", nil)
if err != nil {

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// No testdata on Android.
// +build !android
package ssautil_test
import (

View File

@ -2,6 +2,10 @@
// 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
package ssa_test
// This file runs the SSA builder in sanity-checking mode on all

View File

@ -25,7 +25,8 @@ import (
// import.
func skipSpecialPlatforms(t *testing.T) {
switch platform := runtime.GOOS + "-" + runtime.GOARCH; platform {
case "nacl-amd64p32",
case "android-arm",
"nacl-amd64p32",
"nacl-386",
"nacl-arm",
"darwin-arm",

View File

@ -9,6 +9,7 @@ import (
"os"
"path/filepath"
"reflect"
"runtime"
"strings"
"testing"
)
@ -16,6 +17,10 @@ import (
// Test that RepoRootForImportPath creates the correct RepoRoot for a given importPath.
// TODO(cmang): Add tests for SVN and BZR.
func TestRepoRootForImportPath(t *testing.T) {
if runtime.GOOS == "android" {
t.Skipf("incomplete source tree on %s", runtime.GOOS)
}
tests := []struct {
path string
want *RepoRoot

View File

@ -198,6 +198,8 @@ func doQuery(out io.Writer, q *query, useJson bool) {
func TestOracle(t *testing.T) {
switch runtime.GOOS {
case "android":
t.Skipf("skipping test on %q (no testdata dir)", runtime.GOOS)
case "windows":
t.Skipf("skipping test on %q (no /usr/bin/diff)", runtime.GOOS)
}

View File

@ -1,3 +1,11 @@
// 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.
// No testdata on Android.
// +build !android
package eg_test
import (

View File

@ -1,3 +1,11 @@
// 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.
// Incomplete std lib sources on Android.
// +build !android
package importgraph_test
import (

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Incomplete std lib sources on Android.
// +build !android
package lexical
import (