]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: add missing cgo conditions in script tests
authorBryan C. Mills <bcmills@google.com>
Mon, 18 Oct 2021 18:59:05 +0000 (14:59 -0400)
committerBryan Mills <bcmills@google.com>
Tue, 7 Dec 2021 18:44:37 +0000 (18:44 +0000)
Change-Id: I7cd1643b2dd5c00be84574d17830b1d5383643fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/356610
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/testdata/script/build_overlay.txt
src/cmd/go/testdata/script/list_swigcxx.txt
src/cmd/go/testdata/script/test_build_failure.txt

index 2932b94e6c42c70cdec8884c1e36dc281e063369..56e812f44b29e7eb943f4302a17a4aeb825582bb 100644 (file)
@@ -31,17 +31,17 @@ exec ./print_trimpath_two_files$GOEXE
 stdout $WORK[/\\]gopath[/\\]src[/\\]m[/\\]printpath[/\\]main.go
 stdout $WORK[/\\]gopath[/\\]src[/\\]m[/\\]printpath[/\\]other.go
 
-go build -overlay overlay.json -o main_cgo_replace$GOEXE ./cgo_hello_replace
-exec ./main_cgo_replace$GOEXE
-stdout '^hello cgo\r?\n'
+[cgo] go build -overlay overlay.json -o main_cgo_replace$GOEXE ./cgo_hello_replace
+[cgo] exec ./main_cgo_replace$GOEXE
+[cgo] stdout '^hello cgo\r?\n'
 
-go build -overlay overlay.json -o main_cgo_quote$GOEXE ./cgo_hello_quote
-exec ./main_cgo_quote$GOEXE
-stdout '^hello cgo\r?\n'
+[cgo] go build -overlay overlay.json -o main_cgo_quote$GOEXE ./cgo_hello_quote
+[cgo] exec ./main_cgo_quote$GOEXE
+[cgo] stdout '^hello cgo\r?\n'
 
-go build -overlay overlay.json -o main_cgo_angle$GOEXE ./cgo_hello_angle
-exec ./main_cgo_angle$GOEXE
-stdout '^hello cgo\r?\n'
+[cgo] go build -overlay overlay.json -o main_cgo_angle$GOEXE ./cgo_hello_angle
+[cgo] exec ./main_cgo_angle$GOEXE
+[cgo] stdout '^hello cgo\r?\n'
 
 go build -overlay overlay.json -o main_call_asm$GOEXE ./call_asm
 exec ./main_call_asm$GOEXE
@@ -55,11 +55,11 @@ cp overlay/test_cache_different.go overlay/test_cache.go
 go list -overlay overlay.json -f '{{.Stale}}' ./test_cache
 stdout '^true$'
 
-go list -compiled -overlay overlay.json -f '{{range .CompiledGoFiles}}{{. | printf "%s\n"}}{{end}}' ./cgo_hello_replace
-cp stdout compiled_cgo_sources.txt
-go run ../print_line_comments.go compiled_cgo_sources.txt
-stdout $GOPATH[/\\]src[/\\]m[/\\]cgo_hello_replace[/\\]cgo_hello_replace.go
-! stdout $GOPATH[/\\]src[/\\]m[/\\]overlay[/\\]hello.c
+[cgo] go list -compiled -overlay overlay.json -f '{{range .CompiledGoFiles}}{{. | printf "%s\n"}}{{end}}' ./cgo_hello_replace
+[cgo] cp stdout compiled_cgo_sources.txt
+[cgo] go run ../print_line_comments.go compiled_cgo_sources.txt
+[cgo] stdout $GOPATH[/\\]src[/\\]m[/\\]cgo_hello_replace[/\\]cgo_hello_replace.go
+[cgo] ! stdout $GOPATH[/\\]src[/\\]m[/\\]overlay[/\\]hello.c
 
 # Run same tests but with gccgo.
 env GO111MODULE=off
index c6acd9ecdbabf4b467c37fd262344be45dac8fec..d4227a80e8e8834d3af5608c3ee94f7e731a490c 100644 (file)
@@ -2,17 +2,19 @@
 
 [!exec:swig] skip
 [!exec:g++] skip
+[!cgo] skip
 
 # CompiledGoFiles should contain 4 files:
 #  a.go
 #  a.swigcxx.go
 #  _cgo_gotypes.go
 #  a.cgo1.go
+#
+# These names we see here, other than a.go, will be from the build cache,
+# so we just count them.
 
 go list -f '{{.CompiledGoFiles}}' -compiled=true example/swig
 
-# These names we see here, other than a.go, will be from the build cache,
-# so we just count them.
 stdout a\.go
 stdout -count=3 $GOCACHE
 
index 8d13634c8c4321f877f7459be74cbba2736f7e58..e8c984f272c33bbf95b8c1c2eb1f8427a76a2d6c 100644 (file)
@@ -3,7 +3,7 @@
 ! go test -x coverbad
 ! stderr '[\\/]coverbad\.test( |$)' # 'go test' should not claim to have run the test.
 stderr 'undefined: g'
-stderr 'undefined: j'
+[cgo] stderr 'undefined: j'
 
 -- go.mod --
 module coverbad