From: Bryan C. Mills Date: Fri, 29 Oct 2021 16:07:55 +0000 (-0400) Subject: cmd/go: make assertions more precise in TestScript/gcflags_patterns X-Git-Tag: go1.18beta1~672 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6afdf01e5385183bea4ba2661bb4088b32626b3d;p=gostls13.git cmd/go: make assertions more precise in TestScript/gcflags_patterns This fixes a rare test flake observed in https://build.golang.org/log/18e531785e7f8b3e6a6d5231787a9d8bdd4a60ea. Change-Id: I0986752f5c1abc626070b9f8ecf34c629a15cd2a Reviewed-on: https://go-review.googlesource.com/c/go/+/359735 Trust: Bryan C. Mills Run-TryBot: Bryan C. Mills TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/go/testdata/script/gcflags_patterns.txt b/src/cmd/go/testdata/script/gcflags_patterns.txt index e9521c2fb2..5b81e9481a 100644 --- a/src/cmd/go/testdata/script/gcflags_patterns.txt +++ b/src/cmd/go/testdata/script/gcflags_patterns.txt @@ -7,24 +7,24 @@ env GOCACHE=$WORK/gocache # Looking for compile commands, so need a clean cache # -gcflags=-e applies to named packages, not dependencies go build -n -v -gcflags=-e z1 z2 -stderr 'compile.* -p z1.* -e' -stderr 'compile.* -p z2.* -e' +stderr 'compile.* -p z1.* -e ' +stderr 'compile.* -p z2.* -e ' stderr 'compile.* -p y' -! stderr 'compile.* -p [^z].* -e' +! stderr 'compile.* -p [^z].* -e ' # -gcflags can specify package=flags, and can be repeated; last match wins go build -n -v -gcflags=-e -gcflags=z1=-N z1 z2 -stderr 'compile.* -p z1.* -N' -! stderr 'compile.* -p z1.* -e' -! stderr 'compile.* -p z2.* -N' -stderr 'compile.* -p z2.* -e' +stderr 'compile.* -p z1.* -N ' +! stderr 'compile.* -p z1.* -e ' +! stderr 'compile.* -p z2.* -N ' +stderr 'compile.* -p z2.* -e ' stderr 'compile.* -p y' -! stderr 'compile.* -p [^z].* -e' -! stderr 'compile.* -p [^z].* -N' +! stderr 'compile.* -p [^z].* -e ' +! stderr 'compile.* -p [^z].* -N ' # -gcflags can have arbitrary spaces around the flags go build -n -v -gcflags=' z1 = -e ' z1 -stderr 'compile.* -p z1.* -e' +stderr 'compile.* -p z1.* -e ' # -gcflags='all=-e' should apply to all packages, even with go test go test -c -n -gcflags='all=-e' z1