]> Cypherpunks repositories - gostls13.git/commit
[dev.cmdgo] cmd/go: add -testsum flag to update go.sum in script tests
authorJay Conrod <jayconrod@google.com>
Tue, 20 Jul 2021 21:37:53 +0000 (14:37 -0700)
committerJay Conrod <jayconrod@google.com>
Tue, 27 Jul 2021 23:11:31 +0000 (23:11 +0000)
commit72233d27c4dcbbbbb53f06bdafd4a0fb8d652662
treeca3f7e97179515e812ea7b6659d30ad9633b07be
parentb2205eab0efef6cba784aca4436cb0ef8ac0a4de
[dev.cmdgo] cmd/go: add -testsum flag to update go.sum in script tests

-testsum may be set to "tidy", "listm", or "listall". When set,
TestScript runs 'go mod tidy', 'go list -m -mod=mod all', or
'go list -mod=mod all' at the beginning of each test that has a go.mod
file in its root directory. If the test passes and go.mod or go.sum
was updated, TestScript will rewrite the test file with the initial
content of go.mod and go.sum (after the above command).

This is useful for writing tests that need a working go.sum and for
fixing tests that rely on -mod=mod.

For golang/go#41302

Change-Id: I63a5667621a5082ccedfc1bff33c3969c29e8b3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/336150
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/script_test.go