]> Cypherpunks repositories - gostls13.git/commitdiff
all: move //go:debug decoratemappings=0 test to cmd/go
authorMichael Pratt <mpratt@google.com>
Tue, 11 Mar 2025 19:09:46 +0000 (15:09 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 11 Mar 2025 22:07:33 +0000 (15:07 -0700)
test/decoratemappingszero.go is intended to test that
//go:debug decoratemappings=0 disables annonations.

Unfortunately, //go:debug processing is handled by cmd/go, but
cmd/internal/testdir (which runs tests from test/) generally invokes the
compiler directly, thus it does not set default GODEBUGs.

Move this test to the cmd/go script tests, alongside the similar test
for language version.

Fixes #72772.

Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64le_power10
Change-Id: I6a6a636c9d380ef984f760be5689fdc7f5cb2aeb
Reviewed-on: https://go-review.googlesource.com/c/go/+/656795
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

src/cmd/go/testdata/script/godebug_decoratemappings_124.txt [moved from src/cmd/go/testdata/script/godebug_decoratemappings.txt with 100% similarity]
src/cmd/go/testdata/script/godebug_decoratemappings_comment.txt [moved from test/decoratemappingszero.go with 54% similarity]

similarity index 54%
rename from test/decoratemappingszero.go
rename to src/cmd/go/testdata/script/godebug_decoratemappings_comment.txt
index 162e55340542b3b3c527bc5c78fa33ce368c9adf..7568812e37b3062284e5644926380316dae40193 100644 (file)
@@ -1,14 +1,18 @@
-// run
+env GO111MODULE=on
 
-// Copyright 2025 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
+[!GOOS:linux] skip
+[short] skip
 
-// Disable mapping annotations, which only exists for Linux.
+# Programs with //go:debug decoratemappings=0 should never see annotations.
+# This ensures that the runtime has not overridden the default.
+go run .
 
-//go:debug decoratemappings=0
-//go:build linux
+-- go.mod --
+go 1.25
+module m
 
+-- main.go --
+//go:debug decoratemappings=1
 package main
 
 import (