diff --git a/cmd/cover/cover_test.go b/cmd/cover/cover_test.go index d5219a7a..a18778b5 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 7320e22f..c8f7bc37 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 25ee6876..6a09e3de 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 552ad6c8..d5bd964b 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 f156829e..10dae177 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 e8ddda47..38348c0b 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 26eec494..e5aa846d 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 ee47425e..78b43491 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 f7d53a7e..602590e9 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 f5c45abb..b62ecfbb 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 8dfce96b..2744d4ff 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 21afdf27..ef7c6523 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 89e23bd5..f36c23e3 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 95df8821..75669c1c 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 2acbd7e1..a47dbeff 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 f64a93ac..d339d07d 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 96e10d4d..5a0535f5 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 226a3e41..d77f20b0 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 f1353c7f..0dd1cdcd 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 3c10bef8..295e842b 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 522e5cbc..a486c26b 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 fd237cea..77287a43 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 (