mirror of
https://github.com/golang/go.git
synced 2025-05-09 09:33:03 +00:00
undo CL 5754063 / e23b66fcfc94
Does not actually test so files. ««« original CL description misc/cgo: re-enable testso Also enabled it for darwin. R=rsc CC=golang-dev https://golang.org/cl/5754063 »»» R=golang-dev, minux.ma, r, f CC=golang-dev https://golang.org/cl/5756075
This commit is contained in:
parent
ae7a843471
commit
afb1b0e6b7
22
misc/cgo/testso/Makefile
Normal file
22
misc/cgo/testso/Makefile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
include ../../../src/Make.inc
|
||||||
|
|
||||||
|
TARG=cgosotest
|
||||||
|
|
||||||
|
CGO_DEPS+=libcgoso.so
|
||||||
|
CGO_LDFLAGS+=-lcgoso -L.
|
||||||
|
CLEANFILES+=out libcgoso.so
|
||||||
|
CGOFILES=\
|
||||||
|
cgoso.go\
|
||||||
|
|
||||||
|
include ../../../src/Make.pkg
|
||||||
|
|
||||||
|
libcgoso.so: cgoso_c.c
|
||||||
|
gcc cgoso_c.c -fPIC -o $@ $(_CGO_CFLAGS_$(GOARCH)) $(_CGO_LDFLAGS_$(GOOS))
|
||||||
|
|
||||||
|
out: install main.go
|
||||||
|
$(GC) $(GCFLAGS) $(GCIMPORTS) main.go
|
||||||
|
$(LD) -o $@ main.$O
|
@ -1,7 +0,0 @@
|
|||||||
package cgosotest
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestCgoSo(t *testing.T) { Test() }
|
|
11
misc/cgo/testso/main.go
Normal file
11
misc/cgo/testso/main.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "cgosotest"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
cgosotest.Test()
|
||||||
|
}
|
9
misc/cgo/testso/test.bash
Executable file
9
misc/cgo/testso/test.bash
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
gomake out
|
||||||
|
LD_LIBRARY_PATH=. ./out
|
||||||
|
gomake clean
|
@ -57,10 +57,13 @@ BROKEN=true
|
|||||||
go test
|
go test
|
||||||
) || exit $?
|
) || exit $?
|
||||||
|
|
||||||
|
$BROKEN ||
|
||||||
[ "$CGO_ENABLED" != 1 ] ||
|
[ "$CGO_ENABLED" != 1 ] ||
|
||||||
[ "$GOHOSTOS" == windows ] ||
|
[ "$GOHOSTOS" == windows ] ||
|
||||||
|
[ "$GOHOSTOS" == darwin ] ||
|
||||||
(xcd ../misc/cgo/testso
|
(xcd ../misc/cgo/testso
|
||||||
go test
|
"$GOMAKE" clean
|
||||||
|
./test.bash
|
||||||
) || exit $?
|
) || exit $?
|
||||||
|
|
||||||
(xcd ../doc/progs
|
(xcd ../doc/progs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user