diff --git a/cmd/cover/cover_test.go b/cmd/cover/cover_test.go index d5219a7a33..a18778b5b4 100644 --- a/cmd/cover/cover_test.go +++ b/cmd/cover/cover_test.go @@ -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 ( diff --git a/cmd/fiximports/main_test.go b/cmd/fiximports/main_test.go index 7320e22f4a..c8f7bc37a7 100644 --- a/cmd/fiximports/main_test.go +++ b/cmd/fiximports/main_test.go @@ -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 ( diff --git a/cmd/vet/vet_test.go b/cmd/vet/vet_test.go index 25ee687693..6a09e3de4b 100644 --- a/cmd/vet/vet_test.go +++ b/cmd/vet/vet_test.go @@ -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 ( diff --git a/go/buildutil/allpackages_test.go b/go/buildutil/allpackages_test.go index 552ad6c865..d5bd964b4f 100644 --- a/go/buildutil/allpackages_test.go +++ b/go/buildutil/allpackages_test.go @@ -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 ( diff --git a/go/buildutil/util_test.go b/go/buildutil/util_test.go index f156829e8b..10dae17749 100644 --- a/go/buildutil/util_test.go +++ b/go/buildutil/util_test.go @@ -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 ( diff --git a/go/callgraph/cha/cha_test.go b/go/callgraph/cha/cha_test.go index e8ddda4731..38348c0bde 100644 --- a/go/callgraph/cha/cha_test.go +++ b/go/callgraph/cha/cha_test.go @@ -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 ( diff --git a/go/callgraph/rta/rta_test.go b/go/callgraph/rta/rta_test.go index 26eec49445..e5aa846d6f 100644 --- a/go/callgraph/rta/rta_test.go +++ b/go/callgraph/rta/rta_test.go @@ -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 ( diff --git a/go/gccgoimporter/importer_test.go b/go/gccgoimporter/importer_test.go index ee47425eec..78b4349143 100644 --- a/go/gccgoimporter/importer_test.go +++ b/go/gccgoimporter/importer_test.go @@ -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) diff --git a/go/loader/loader_test.go b/go/loader/loader_test.go index f7d53a7ef2..602590e9f8 100644 --- a/go/loader/loader_test.go +++ b/go/loader/loader_test.go @@ -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 ( diff --git a/go/loader/stdlib_test.go b/go/loader/stdlib_test.go index f5c45abbde..b62ecfbb41 100644 --- a/go/loader/stdlib_test.go +++ b/go/loader/stdlib_test.go @@ -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, diff --git a/go/pointer/pointer_test.go b/go/pointer/pointer_test.go index 8dfce96b74..2744d4fff4 100644 --- a/go/pointer/pointer_test.go +++ b/go/pointer/pointer_test.go @@ -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 diff --git a/go/pointer/stdlib_test.go b/go/pointer/stdlib_test.go index 21afdf274f..ef7c6523aa 100644 --- a/go/pointer/stdlib_test.go +++ b/go/pointer/stdlib_test.go @@ -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 diff --git a/go/ssa/interp/interp_test.go b/go/ssa/interp/interp_test.go index 89e23bd5d7..f36c23e34d 100644 --- a/go/ssa/interp/interp_test.go +++ b/go/ssa/interp/interp_test.go @@ -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 diff --git a/go/ssa/source_test.go b/go/ssa/source_test.go index 95df882146..75669c1cf8 100644 --- a/go/ssa/source_test.go +++ b/go/ssa/source_test.go @@ -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 { diff --git a/go/ssa/ssautil/switch_test.go b/go/ssa/ssautil/switch_test.go index 2acbd7e1c3..a47dbeff7f 100644 --- a/go/ssa/ssautil/switch_test.go +++ b/go/ssa/ssautil/switch_test.go @@ -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 ( diff --git a/go/ssa/stdlib_test.go b/go/ssa/stdlib_test.go index f64a93ac09..d339d07dd7 100644 --- a/go/ssa/stdlib_test.go +++ b/go/ssa/stdlib_test.go @@ -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 diff --git a/go/types/api_test.go b/go/types/api_test.go index 96e10d4d95..5a0535f5b6 100644 --- a/go/types/api_test.go +++ b/go/types/api_test.go @@ -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", diff --git a/go/vcs/vcs_test.go b/go/vcs/vcs_test.go index 226a3e41ba..d77f20b0b6 100644 --- a/go/vcs/vcs_test.go +++ b/go/vcs/vcs_test.go @@ -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 diff --git a/oracle/oracle_test.go b/oracle/oracle_test.go index f1353c7f66..0dd1cdcdbe 100644 --- a/oracle/oracle_test.go +++ b/oracle/oracle_test.go @@ -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) } diff --git a/refactor/eg/eg_test.go b/refactor/eg/eg_test.go index 3c10bef859..295e842b57 100644 --- a/refactor/eg/eg_test.go +++ b/refactor/eg/eg_test.go @@ -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 ( diff --git a/refactor/importgraph/graph_test.go b/refactor/importgraph/graph_test.go index 522e5cbc31..a486c26b76 100644 --- a/refactor/importgraph/graph_test.go +++ b/refactor/importgraph/graph_test.go @@ -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 ( diff --git a/refactor/lexical/lexical_test.go b/refactor/lexical/lexical_test.go index fd237cea95..77287a4398 100644 --- a/refactor/lexical/lexical_test.go +++ b/refactor/lexical/lexical_test.go @@ -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 (