mirror of
https://github.com/golang/go
synced 2024-11-21 21:14:47 -07:00
go/build: fix build (revert test changes)
R=adg TBR=adg CC=golang-dev https://golang.org/cl/5024046
This commit is contained in:
parent
17bebd3caa
commit
6430f46e4b
@ -45,12 +45,10 @@ var buildPkgs = []struct {
|
|||||||
{
|
{
|
||||||
"go/build/cgotest",
|
"go/build/cgotest",
|
||||||
&DirInfo{
|
&DirInfo{
|
||||||
CgoFiles: []string{"cgotest.go"},
|
CgoFiles: []string{"cgotest.go"},
|
||||||
CFiles: []string{"cgotest.c"},
|
CFiles: []string{"cgotest.c"},
|
||||||
Imports: []string{"C", "unsafe"},
|
Imports: []string{"C", "unsafe"},
|
||||||
Package: "cgotest",
|
Package: "cgotest",
|
||||||
CgoLDFLAGS: []string{"-lregexp"},
|
|
||||||
CgoPkgConfig: []string{"cairo", "moscow"},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -58,11 +56,10 @@ var buildPkgs = []struct {
|
|||||||
const cmdtestOutput = "3"
|
const cmdtestOutput = "3"
|
||||||
|
|
||||||
func TestBuild(t *testing.T) {
|
func TestBuild(t *testing.T) {
|
||||||
var ctxt = Context{GOOS: "darwin", GOARCH: "amd64"}
|
|
||||||
for _, tt := range buildPkgs {
|
for _, tt := range buildPkgs {
|
||||||
tree := Path[0] // Goroot
|
tree := Path[0] // Goroot
|
||||||
dir := filepath.Join(tree.SrcDir(), tt.dir)
|
dir := filepath.Join(tree.SrcDir(), tt.dir)
|
||||||
info, err := ctxt.ScanDir(dir)
|
info, err := ScanDir(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("ScanDir(%#q): %v", tt.dir, err)
|
t.Errorf("ScanDir(%#q): %v", tt.dir, err)
|
||||||
continue
|
continue
|
||||||
@ -72,13 +69,6 @@ func TestBuild(t *testing.T) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if tt.dir == "go/build/cgotest" {
|
|
||||||
// Don't actually run cgo.
|
|
||||||
// Among other things our test depends
|
|
||||||
// on pkg-config, which is not present on all systems.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
s, err := Build(tree, tt.dir, info)
|
s, err := Build(tree, tt.dir, info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Build(%#q): %v", tt.dir, err)
|
t.Errorf("Build(%#q): %v", tt.dir, err)
|
||||||
|
@ -6,9 +6,6 @@ package cgotest
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
char* greeting = "hello, world";
|
char* greeting = "hello, world";
|
||||||
#cgo darwin/amd64 LDFLAGS: -lregexp
|
|
||||||
#cgo linux CFLAGS: -m32
|
|
||||||
#cgo pkg-config: cairo moscow
|
|
||||||
*/
|
*/
|
||||||
// #include "cgotest.h"
|
// #include "cgotest.h"
|
||||||
import "C"
|
import "C"
|
||||||
|
Loading…
Reference in New Issue
Block a user