aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/cgo/internal/testshared/shared_test.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2023-05-22 10:32:31 -0400
committerAustin Clements <austin@google.com>2023-05-22 20:56:09 +0000
commita1f3dc33dced2d337261b693b1ef1bf6a5bbce8d (patch)
tree991824c08b95c01cf7591d90db9cdeb1c9ac562d /src/cmd/cgo/internal/testshared/shared_test.go
parent96a773d61bc60022af0097f4a08495880a5ea33e (diff)
downloadgo-a1f3dc33dced2d337261b693b1ef1bf6a5bbce8d.tar.xz
cmd/cgo: merge overlayDir into one package
There are many copies of overlaydir_test.go between the cgo tests from when these couldn't share code. Now that they can, merge these copies into a cmd/cgo/internal/cgotest package. Change-Id: I203217f5d08e6306cb049a13718652cf7c447b80 Reviewed-on: https://go-review.googlesource.com/c/go/+/497078 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/cgo/internal/testshared/shared_test.go')
-rw-r--r--src/cmd/cgo/internal/testshared/shared_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/cgo/internal/testshared/shared_test.go b/src/cmd/cgo/internal/testshared/shared_test.go
index 05e87b9d50..6596d88952 100644
--- a/src/cmd/cgo/internal/testshared/shared_test.go
+++ b/src/cmd/cgo/internal/testshared/shared_test.go
@@ -7,6 +7,7 @@ package shared_test
import (
"bufio"
"bytes"
+ "cmd/cgo/internal/cgotest"
"debug/elf"
"encoding/binary"
"flag"
@@ -203,7 +204,7 @@ func TestMain(m *testing.M) {
// It returns the directory within gopath at which the module root is located.
func cloneTestdataModule(gopath string) (string, error) {
modRoot := filepath.Join(gopath, "src", "testshared")
- if err := overlayDir(modRoot, "testdata"); err != nil {
+ if err := cgotest.OverlayDir(modRoot, "testdata"); err != nil {
return "", err
}
if err := os.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module testshared\n"), 0644); err != nil {
@@ -255,7 +256,7 @@ func cloneGOROOTDeps(goroot string) error {
if testing.Verbose() {
fmt.Fprintf(os.Stderr, "+ cp -r %s %s\n", filepath.Join(oldGOROOT, dir), filepath.Join(goroot, dir))
}
- if err := overlayDir(filepath.Join(goroot, dir), filepath.Join(oldGOROOT, dir)); err != nil {
+ if err := cgotest.OverlayDir(filepath.Join(goroot, dir), filepath.Join(oldGOROOT, dir)); err != nil {
return err
}
}