Skip to content

Commit f4f7db4

Browse files
committed
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>
1 parent e5f5607 commit f4f7db4

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

src/cmd/go/go_test.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,27 +1694,6 @@ func TestShadowingLogic(t *testing.T) {
16941694
}
16951695
}
16961696

1697-
func TestBuildDryRunWithCgo(t *testing.T) {
1698-
if !canCgo {
1699-
t.Skip("skipping because cgo not enabled")
1700-
}
1701-
1702-
tg := testgo(t)
1703-
defer tg.cleanup()
1704-
tg.tempFile("foo.go", `package main
1705-
1706-
/*
1707-
#include <limits.h>
1708-
*/
1709-
import "C"
1710-
1711-
func main() {
1712-
println(C.INT_MAX)
1713-
}`)
1714-
tg.run("build", "-n", tg.path("foo.go"))
1715-
tg.grepStderrNot(`os.Stat .* no such file or directory`, "unexpected stat of archive file")
1716-
}
1717-
17181697
func TestCgoDependsOnSyscall(t *testing.T) {
17191698
if testing.Short() {
17201699
t.Skip("skipping test that removes $GOROOT/pkg/*_race in short mode")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Tests golang.org/issue/14944
2+
3+
[!cgo] skip
4+
5+
go build -n foo.go
6+
! stderr 'os.Stat .* no such file or directory' # there shouldn't be a stat of the archive file
7+
8+
-- foo.go --
9+
package main
10+
11+
/*
12+
#include <limits.h>
13+
*/
14+
import "C"
15+
16+
func main() {
17+
println(C.INT_MAX)
18+
}

0 commit comments

Comments
 (0)