1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354
|
Description: Disable tests that don't work when using gccgo-7
Initially created by Martín for gccgo-6 in Stretch.
Updated by Anthony for gccgo-7 (7.1.0) and latest x/tools snapshot.
Author: Martín Ferrari <tincho@debian.org>
Author: Anthony Fok <foka@debian.org>
Origin: vendor
Forwarded: no
Last-Update: 2017-07-07
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/cmd/godoc/godoc_test.go
+++ b/cmd/godoc/godoc_test.go
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build !gccgo
+
package main_test
import (
--- a/cmd/gorename/gorename_test.go
+++ b/cmd/gorename/gorename_test.go
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build !gccgo
+
package main_test
import (
--- a/cmd/guru/guru_test.go
+++ b/cmd/guru/guru_test.go
@@ -234,6 +234,9 @@
case "windows":
t.Skipf("skipping test on %q (no /usr/bin/diff)", runtime.GOOS)
}
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
for _, filename := range []string{
"testdata/src/alias/alias.go", // iff guru.HasAlias (go1.9)
--- a/cmd/stringer/endtoend_test.go
+++ b/cmd/stringer/endtoend_test.go
@@ -5,6 +5,7 @@
// go command is not available on android
// +build !android
+// +build !gccgo
package main
--- a/go/buildutil/util_test.go
+++ b/go/buildutil/util_test.go
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build !gccgo
+
package buildutil_test
import (
--- a/go/gcexportdata/example_test.go
+++ b/go/gcexportdata/example_test.go
@@ -4,6 +4,7 @@
// +build go1.7
// +build gc
+// +build !gccgo
package gcexportdata_test
--- a/go/loader/example_test.go
+++ b/go/loader/example_test.go
@@ -4,6 +4,7 @@
// +build go1.8,!go1.9 // TODO(adonovan) determine which versions we need to test here
// +build !windows
+// +build !gccgo
package loader_test
--- a/go/loader/loader_test.go
+++ b/go/loader/loader_test.go
@@ -110,6 +110,10 @@
}
func TestLoad_MissingInitialPackage(t *testing.T) {
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
+
var conf loader.Config
conf.Import("nosuchpkg")
conf.Import("errors")
@@ -813,8 +817,18 @@
// Load package "io" twice in parallel.
// When run with -race, this is a regression test for Go issue 20718, in
// which the global "unsafe" package was modified concurrently.
-func TestLoad1(t *testing.T) { loadIO(t) }
-func TestLoad2(t *testing.T) { loadIO(t) }
+func TestLoad1(t *testing.T) {
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
+ loadIO(t)
+}
+func TestLoad2(t *testing.T) {
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
+ loadIO(t)
+}
func loadIO(t *testing.T) {
t.Parallel()
--- a/go/loader/stdlib_test.go
+++ b/go/loader/stdlib_test.go
@@ -30,6 +30,9 @@
if runtime.GOOS == "android" {
t.Skipf("incomplete std lib on %s", runtime.GOOS)
}
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
if testing.Short() {
t.Skip("skipping in short mode; uses tons of memory (https://golang.org/issue/14113)")
}
@@ -128,6 +131,9 @@
case "android", "plan9", "solaris", "windows":
t.Skipf("no cgo or incomplete std lib on %s", runtime.GOOS)
}
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
// In nocgo builds (e.g. linux-amd64-nocgo),
// there is no "runtime/cgo" package,
// so cgo-generated Go files will have a failing import.
--- a/go/pointer/example_test.go
+++ b/go/pointer/example_test.go
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build !gccgo
+
package pointer_test
import (
--- a/go/pointer/pointer_test.go
+++ b/go/pointer/pointer_test.go
@@ -5,6 +5,7 @@
// No testdata on Android.
// +build !android
+// +build !gccgo
package pointer_test
--- a/go/ssa/builder_test.go
+++ b/go/ssa/builder_test.go
@@ -13,6 +13,7 @@
"go/types"
"os"
"reflect"
+ "runtime"
"sort"
"strings"
"testing"
@@ -27,6 +28,10 @@
// Tests that programs partially loaded from gc object files contain
// functions with no code for the external portions, but are otherwise ok.
func TestBuildPackage(t *testing.T) {
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
+
input := `
package main
@@ -158,6 +163,10 @@
// TestRuntimeTypes tests that (*Program).RuntimeTypes() includes all necessary types.
func TestRuntimeTypes(t *testing.T) {
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
+
tests := []struct {
input string
want []string
@@ -255,6 +264,10 @@
// and to simplify the analysis whereby it deduces which stores to globals
// can be lowered to global initializers.
func TestInit(t *testing.T) {
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
+
tests := []struct {
mode ssa.BuilderMode
input, want string
--- a/go/ssa/example_test.go
+++ b/go/ssa/example_test.go
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build !gccgo
+
package ssa_test
import (
--- a/go/ssa/interp/interp_test.go
+++ b/go/ssa/interp/interp_test.go
@@ -3,6 +3,7 @@
// license that can be found in the LICENSE file.
// +build linux darwin
+// +build !gccgo
package interp_test
--- a/go/ssa/source_test.go
+++ b/go/ssa/source_test.go
@@ -30,6 +30,9 @@
if runtime.GOOS == "android" {
t.Skipf("no testdata directory on %s", runtime.GOOS)
}
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
conf := loader.Config{ParserMode: parser.ParseComments}
src, err := ioutil.ReadFile("testdata/objlookup.go")
--- a/go/ssa/ssautil/load_test.go
+++ b/go/ssa/ssautil/load_test.go
@@ -12,6 +12,7 @@
"go/token"
"go/types"
"os"
+ "runtime"
"strings"
"testing"
@@ -32,6 +33,10 @@
// There is a more substantial test of BuildPackage and the
// SSA program it builds in ../ssa/builder_test.go.
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
+
fset := token.NewFileSet()
f, err := parser.ParseFile(fset, "hello.go", hello, 0)
if err != nil {
--- a/go/ssa/stdlib_test.go
+++ b/go/ssa/stdlib_test.go
@@ -5,6 +5,7 @@
// Incomplete source tree on Android.
// +build !android
+// +build !gccgo
package ssa_test
--- a/go/ssa/testmain_test.go
+++ b/go/ssa/testmain_test.go
@@ -9,6 +9,7 @@
import (
"fmt"
+ "runtime"
"sort"
"testing"
@@ -36,6 +37,10 @@
}
func TestFindTests(t *testing.T) {
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
+
test := `
package foo
--- a/refactor/eg/eg_test.go
+++ b/refactor/eg/eg_test.go
@@ -5,6 +5,7 @@
// No testdata on Android.
// +build !android
+// +build !gccgo
package eg_test
--- a/refactor/importgraph/graph_test.go
+++ b/refactor/importgraph/graph_test.go
@@ -5,6 +5,7 @@
// Incomplete std lib sources on Android.
// +build !android
+// +build !gccgo
package importgraph_test
--- a/refactor/rename/rename_test.go
+++ b/refactor/rename/rename_test.go
@@ -1283,6 +1283,9 @@
if runtime.GOOS == "plan9" {
t.Skipf("plan9 diff tool doesn't support -u flag")
}
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
defer func() {
Diff = false
--- a/cmd/gorename/cgo_test.go
+++ b/cmd/gorename/cgo_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 cgo
+// +build cgo,!gccgo
package main_test
--- a/container/intsets/sparse_test.go
+++ b/container/intsets/sparse_test.go
@@ -8,6 +8,7 @@
"fmt"
"log"
"math/rand"
+ "runtime"
"sort"
"strings"
"testing"
@@ -576,6 +577,10 @@
}
func TestFailFastOnShallowCopy(t *testing.T) {
+ if runtime.Compiler == "gccgo" {
+ t.Skip("Test disabled on gccgo.")
+ }
+
var x intsets.Sparse
x.Insert(1)
|