-
Notifications
You must be signed in to change notification settings - Fork 17.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: fix test failures with -count=2
In each test, either set the -n flag to avoid writing build artifacts to the cache, or set GOCACHE explicitly to point to a clean cache. Tested manually with 'go test -count=2 cmd/go'. Fixes #37820 Change-Id: I24403e738b1a10d5fe9dc8d98ef27a76ebe2704a Reviewed-on: https://go-review.googlesource.com/c/go/+/223140 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
- Loading branch information
Bryan C. Mills
committed
Mar 12, 2020
1 parent
040855e
commit c4113b6
Showing
5 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
[short] skip | ||
[!cgo] skip | ||
|
||
go run -x main.go | ||
env GOCACHE=$WORK/gocache # Looking for compile flags, so need a clean cache. | ||
go build -x -n main.go | ||
stderr '"-I[^"]+c flags"' # find quoted c flags | ||
! stderr '"-I[^"]+c flags".*"-I[^"]+c flags"' # don't find too many quoted c flags | ||
! stderr '"-I[^"]+c flags".*"-I[^"]+c flags"' # don't find too many quoted c flags per line | ||
stderr '"-L[^"]+ld flags"' # find quoted ld flags | ||
! stderr '"-L[^"]+c flags".*"-L[^"]+c flags"' # don't find too many quoted ld flags | ||
! stderr '"-L[^"]+c flags".*"-L[^"]+c flags"' # don't find too many quoted ld flags per line | ||
|
||
-- main.go -- | ||
package main | ||
// #cgo CFLAGS: -I"c flags" | ||
// #cgo LDFLAGS: -L"ld flags" | ||
import "C" | ||
func main() {} | ||
func main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters