1
0
mirror of https://github.com/golang/go synced 2024-09-30 01:14:29 -06:00

cmd/go: convert TestBuildDryRunWithCgo to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I2d14c07c590cc618c66f27fdc3a2bb8120c6d646
Reviewed-on: https://go-review.googlesource.com/c/go/+/214427
Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
Michael Matloob 2020-01-13 11:14:23 -05:00
parent e5f5607b63
commit f4f7db414d
2 changed files with 18 additions and 21 deletions

View File

@ -1694,27 +1694,6 @@ func TestShadowingLogic(t *testing.T) {
}
}
func TestBuildDryRunWithCgo(t *testing.T) {
if !canCgo {
t.Skip("skipping because cgo not enabled")
}
tg := testgo(t)
defer tg.cleanup()
tg.tempFile("foo.go", `package main
/*
#include <limits.h>
*/
import "C"
func main() {
println(C.INT_MAX)
}`)
tg.run("build", "-n", tg.path("foo.go"))
tg.grepStderrNot(`os.Stat .* no such file or directory`, "unexpected stat of archive file")
}
func TestCgoDependsOnSyscall(t *testing.T) {
if testing.Short() {
t.Skip("skipping test that removes $GOROOT/pkg/*_race in short mode")

View File

@ -0,0 +1,18 @@
# Tests golang.org/issue/14944
[!cgo] skip
go build -n foo.go
! stderr 'os.Stat .* no such file or directory' # there shouldn't be a stat of the archive file
-- foo.go --
package main
/*
#include <limits.h>
*/
import "C"
func main() {
println(C.INT_MAX)
}