]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/script: new hook for adding in toolchain script conditions
authorThan McIntosh <thanm@google.com>
Mon, 29 Jul 2024 17:40:10 +0000 (17:40 +0000)
committerThan McIntosh <thanm@google.com>
Wed, 31 Jul 2024 13:21:14 +0000 (13:21 +0000)
commitb60f88d81022e4172e44aef2f0bdade87ed6916d
treea37a6115cb048aea979ad51eb12f03cf6d9116fb
parent86bec1ec198f2720c83bd232a72b800b4ea5a9f6
cmd/internal/script: new hook for adding in toolchain script conditions

Introduce a new function AddToolChainScriptConditions that augments a
default "script.Cond" set with a collection of useful conditions,
including godebug/goexperiment, cgo, race support, buildmode, asan,
msan, and so on. Having these conditions available makes it easier to
write script tests that deal with specific build-flavor corner cases.
The functions backing the new conditions are helper functions migrated
over from the Go command's script test setup.

Updates #68606.

Change-Id: I14def1115b54dc47529c983abcd2c5ea9326b9de
Reviewed-on: https://go-review.googlesource.com/c/go/+/601715
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/testdata/script/script_test_basics.txt
src/cmd/go/script_test.go
src/cmd/go/scriptconds_test.go
src/cmd/internal/script/scripttest/conditions.go [new file with mode: 0644]
src/cmd/internal/script/scripttest/run.go