mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: add a test to test RODATA is indeed read-only
Updates #38830. Change-Id: Ie1f6ccef40a773f038aac587dfc26bf70a1a8536 Reviewed-on: https://go-review.googlesource.com/c/go/+/253921 Run-TryBot: Cherry Zhang <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
ffd95aadcd
commit
1ed4f12f4a
2 changed files with 36 additions and 0 deletions
|
|
@ -800,3 +800,17 @@ func TestContentAddressableSymbols(t *testing.T) {
|
|||
t.Errorf("command %s failed: %v\n%s", cmd, err, out)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadOnly(t *testing.T) {
|
||||
// Test that read-only data is indeed read-only.
|
||||
testenv.MustHaveGoBuild(t)
|
||||
|
||||
t.Parallel()
|
||||
|
||||
src := filepath.Join("testdata", "testRO", "x.go")
|
||||
cmd := exec.Command(testenv.GoToolPath(t), "run", src)
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err == nil {
|
||||
t.Errorf("running test program did not fail. output:\n%s", out)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue