]> Cypherpunks repositories - gostls13.git/commit
cmd/link: add script testing facility for linker use
authorThan McIntosh <thanm@google.com>
Thu, 25 Jul 2024 18:42:21 +0000 (18:42 +0000)
committerThan McIntosh <thanm@google.com>
Mon, 29 Jul 2024 16:13:11 +0000 (16:13 +0000)
commitf021221a584ede27c18f0e7deb90c438649d5128
treeb73a582f64aff29601e47fc42733ff896586dc94
parent0d8aa5737ecdc03b2723a2af35cb7394335e5411
cmd/link: add script testing facility for linker use

Add support for running script tests as part of the linker's suite of
tests, hooking in the script test engine packages recently moved from
cmd/go to cmd/internal. Linker script tests will use the test binary
itself as the linker for Go builds, and can also run the C compiler if
needed. New script test cases (*.txt files) should be added to the
directory cmd/link/testdata/script.

For demo purposes, this patch also adds a new "randlayout_option.txt"
script test that replicates the existing linker's TestRandLayout
testpoint in script form.

Updates #68606.

Change-Id: Icf26bf657850e39548d6ea819f2542fc68a3899b
Reviewed-on: https://go-review.googlesource.com/c/go/+/601360
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/link/dwarf_test.go
src/cmd/link/script_test.go [new file with mode: 0644]
src/cmd/link/testdata/script/randlayout_option.txt [new file with mode: 0644]
src/cmd/link/testdata/script/script_test_basics.txt [new file with mode: 0644]