Commit dda1b560 authored by Rémy Oudompheng's avatar Rémy Oudompheng

test: convert tests to run.go whenever possible.

The other tests either need a complex procedure
or are architecture- or OS-dependent.

Update #4139.

R=golang-dev, daniel.morsing, iant
CC=golang-dev
https://golang.org/cl/6618062
parent c12dab2a
// Copyright 2010 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.
// This file is compiled and then imported by ddd3.go.
package ddd
func Sum(args ...int) int {
s := 0
for _, v := range args {
s += v
}
return s
}
// $G $D/ddd2.go && $G $D/$F.go && $L $F.$A && ./$A.out
// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.
// Copyright 2010 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.
......
// skip
// rundir
// Copyright 2010 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.
// This file is compiled and then imported by ddd3.go.
package ddd
func Sum(args ...int) int {
s := 0
for _, v := range args {
s += v
}
return s
}
// Test that variadic functions work across package boundaries.
package ignored
// Copyright 2012 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.
// Test converting a type defined in a different package to an
// interface defined in a third package, where the interface has a
// hidden method. This used to cause a link error with gccgo.
package main
import (
"./one"
"./two"
)
func F(i1 one.I1) {
switch v := i1.(type) {
case two.S2:
one.F1(v)
}
}
func main() {
F(nil)
}
// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go && $G $D/$F.go && $L $F.$A && ./$A.out
// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.
// rundir
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
......@@ -11,20 +8,4 @@
// interface defined in a third package, where the interface has a
// hidden method. This used to cause a link error with gccgo.
package main
import (
"./one"
"./two"
)
func F(i1 one.I1) {
switch v := i1.(type) {
case two.S2:
one.F1(v)
}
}
func main() {
F(nil)
}
package ignored
// skip # used by embed1.go
// Copyright 2009 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.
......
// Copyright 2009 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.
// Test that embedded interface types can have local methods.
package main
import "./embed0"
type T int
func (t T) m() {}
type I interface { m() }
type J interface { I }
type PI interface { p.I }
type PJ interface { p.J }
func main() {
var i I
var j J
var t T
i = t
j = t
_ = i
_ = j
i = j
_ = i
j = i
_ = j
var pi PI
var pj PJ
var pt p.T
pi = pt
pj = pt
_ = pi
_ = pj
pi = pj
_ = pi
pj = pi
_ = pj
}
// $G $D/embed0.go && $G $D/$F.go && $L $F.$A && ./$A.out
// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.
// rundir
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
......@@ -9,40 +6,4 @@
// Test that embedded interface types can have local methods.
package main
import "./embed0"
type T int
func (t T) m() {}
type I interface { m() }
type J interface { I }
type PI interface { p.I }
type PJ interface { p.J }
func main() {
var i I
var j J
var t T
i = t
j = t
_ = i
_ = j
i = j
_ = i
j = i
_ = j
var pi PI
var pj PJ
var pt p.T
pi = pt
pj = pt
_ = pi
_ = pj
pi = pj
_ = pi
pj = pi
_ = pj
}
package ignored
// skip # used by private.go
// Copyright 2011 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.
......
// Copyright 2011 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.
// Test that unexported methods are not visible outside the package.
// Does not compile.
package main
import "./private1"
type Exported interface {
private()
}
type Implementation struct{}
func (p *Implementation) private() {}
func main() {
var x Exported
x = new(Implementation)
x.private()
var px p.Exported
px = p.X
px.private() // ERROR "private"
px = new(Implementation) // ERROR "private"
x = px // ERROR "private"
}
// $G $D/${F}1.go && errchk $G $D/$F.go
// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.
// errorcheckdir
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
......@@ -10,29 +7,4 @@
// Test that unexported methods are not visible outside the package.
// Does not compile.
package main
import "./private1"
type Exported interface {
private()
}
type Implementation struct{}
func (p *Implementation) private() {}
func main() {
var x Exported
x = new(Implementation)
x.private()
var px p.Exported
px = p.X
px.private() // ERROR "private"
px = new(Implementation) // ERROR "private"
x = px // ERROR "private"
}
package ignored
// Copyright 2012 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.
// Mutually recursive type definitions imported and used by recursive1.go.
package p
type I1 interface {
F() I2
}
type I2 interface {
I1
}
// $G $D/recursive1.go && $G $D/$F.go
// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.
// Copyright 2012 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.
......
// skip # used by recursive2
// compiledir
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
......@@ -6,12 +6,4 @@
// Mutually recursive type definitions imported and used by recursive1.go.
package p
type I1 interface {
F() I2
}
type I2 interface {
I1
}
package ignored
......@@ -647,16 +647,12 @@ func (t *test) wantedErrors(file, short string) (errs []wantedError) {
var skipOkay = map[string]bool{
"args.go": true,
"ddd3.go": true,
"index.go": true,
"linkx.go": true,
"nul1.go": true,
"rotate.go": true,
"sigchld.go": true,
"sinit.go": true,
"interface/embed1.go": true,
"interface/private.go": true,
"interface/recursive2.go": true,
"dwarf/main.go": true,
"dwarf/z1.go": true,
"dwarf/z10.go": true,
......@@ -686,7 +682,6 @@ var skipOkay = map[string]bool{
"fixedbugs/bug385_32.go": true, // arch-specific errors.
"fixedbugs/bug385_64.go": true, // arch-specific errors.
"fixedbugs/bug429.go": true,
"fixedbugs/bug437.go": true,
"bugs/bug395.go": true,
"bugs/bug434.go": true,
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment