aboutsummaryrefslogtreecommitdiff
path: root/misc/cgo/errors
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2019-02-21 09:06:09 -0500
committerBryan C. Mills <bcmills@google.com>2019-02-22 17:24:25 +0000
commit8ea27e117fffbb14ef3605a641444b79e9bd6c9e (patch)
tree1e36f0447182c7aa54752a948e86ba7b3d3991da /misc/cgo/errors
parentb35dacaac57b039205d9b07ea24098e2c3fcb12e (diff)
downloadgo-8ea27e117fffbb14ef3605a641444b79e9bd6c9e.tar.xz
misc/cgo/errors: fix tests in module mode
Updates #30228 Change-Id: I84bc705591bdb3da0106404b24353251939355b8 Reviewed-on: https://go-review.googlesource.com/c/163209 Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'misc/cgo/errors')
-rw-r--r--misc/cgo/errors/errors_test.go2
-rw-r--r--misc/cgo/errors/ptr_test.go9
-rw-r--r--misc/cgo/errors/testdata/err1.go (renamed from misc/cgo/errors/src/err1.go)0
-rw-r--r--misc/cgo/errors/testdata/err2.go (renamed from misc/cgo/errors/src/err2.go)0
-rw-r--r--misc/cgo/errors/testdata/err3.go (renamed from misc/cgo/errors/src/err3.go)0
-rw-r--r--misc/cgo/errors/testdata/err4.go (renamed from misc/cgo/errors/src/err4.go)0
-rw-r--r--misc/cgo/errors/testdata/issue11097a.go (renamed from misc/cgo/errors/src/issue11097a.go)0
-rw-r--r--misc/cgo/errors/testdata/issue11097b.go (renamed from misc/cgo/errors/src/issue11097b.go)0
-rw-r--r--misc/cgo/errors/testdata/issue13129.go (renamed from misc/cgo/errors/src/issue13129.go)0
-rw-r--r--misc/cgo/errors/testdata/issue13423.go (renamed from misc/cgo/errors/src/issue13423.go)0
-rw-r--r--misc/cgo/errors/testdata/issue13467.go (renamed from misc/cgo/errors/src/issue13467.go)0
-rw-r--r--misc/cgo/errors/testdata/issue13635.go (renamed from misc/cgo/errors/src/issue13635.go)0
-rw-r--r--misc/cgo/errors/testdata/issue13830.go (renamed from misc/cgo/errors/src/issue13830.go)0
-rw-r--r--misc/cgo/errors/testdata/issue14669.go (renamed from misc/cgo/errors/src/issue14669.go)0
-rw-r--r--misc/cgo/errors/testdata/issue16116.go (renamed from misc/cgo/errors/src/issue16116.go)0
-rw-r--r--misc/cgo/errors/testdata/issue16591.go (renamed from misc/cgo/errors/src/issue16591.go)0
-rw-r--r--misc/cgo/errors/testdata/issue18452.go (renamed from misc/cgo/errors/src/issue18452.go)0
-rw-r--r--misc/cgo/errors/testdata/issue18889.go (renamed from misc/cgo/errors/src/issue18889.go)0
-rw-r--r--misc/cgo/errors/testdata/issue26745.go (renamed from misc/cgo/errors/src/issue26745.go)0
-rw-r--r--misc/cgo/errors/testdata/issue28069.go (renamed from misc/cgo/errors/src/issue28069.go)0
-rw-r--r--misc/cgo/errors/testdata/issue28721.go (renamed from misc/cgo/errors/src/issue28721.go)0
-rw-r--r--misc/cgo/errors/testdata/issue7757.go (renamed from misc/cgo/errors/src/issue7757.go)0
-rw-r--r--misc/cgo/errors/testdata/issue8442.go (renamed from misc/cgo/errors/src/issue8442.go)0
-rw-r--r--misc/cgo/errors/testdata/long_double_size.go (renamed from misc/cgo/errors/src/long_double_size.go)0
-rw-r--r--misc/cgo/errors/testdata/malloc.go (renamed from misc/cgo/errors/src/malloc.go)0
25 files changed, 8 insertions, 3 deletions
diff --git a/misc/cgo/errors/errors_test.go b/misc/cgo/errors/errors_test.go
index 59054f4703..f727158c48 100644
--- a/misc/cgo/errors/errors_test.go
+++ b/misc/cgo/errors/errors_test.go
@@ -18,7 +18,7 @@ import (
)
func path(file string) string {
- return filepath.Join("src", file)
+ return filepath.Join("testdata", file)
}
func check(t *testing.T, file string) {
diff --git a/misc/cgo/errors/ptr_test.go b/misc/cgo/errors/ptr_test.go
index 254671f179..629f4c9226 100644
--- a/misc/cgo/errors/ptr_test.go
+++ b/misc/cgo/errors/ptr_test.go
@@ -444,8 +444,8 @@ func testOne(t *testing.T, pt ptrTest) {
}
defer os.RemoveAll(gopath)
- src := filepath.Join(gopath, "src")
- if err := os.Mkdir(src, 0777); err != nil {
+ src := filepath.Join(gopath, "src", "ptrtest")
+ if err := os.MkdirAll(src, 0777); err != nil {
t.Fatal(err)
}
@@ -490,6 +490,11 @@ func testOne(t *testing.T, pt ptrTest) {
}
}
+ gomod := fmt.Sprintf("module %s\n", filepath.Base(src))
+ if err := ioutil.WriteFile(filepath.Join(src, "go.mod"), []byte(gomod), 0666); err != nil {
+ t.Fatalf("writing go.mod: %v", err)
+ }
+
args := func(cmd *exec.Cmd) string {
return strings.Join(cmd.Args, " ")
}
diff --git a/misc/cgo/errors/src/err1.go b/misc/cgo/errors/testdata/err1.go
index 2c232cf58a..2c232cf58a 100644
--- a/misc/cgo/errors/src/err1.go
+++ b/misc/cgo/errors/testdata/err1.go
diff --git a/misc/cgo/errors/src/err2.go b/misc/cgo/errors/testdata/err2.go
index 3ab410bbaa..3ab410bbaa 100644
--- a/misc/cgo/errors/src/err2.go
+++ b/misc/cgo/errors/testdata/err2.go
diff --git a/misc/cgo/errors/src/err3.go b/misc/cgo/errors/testdata/err3.go
index 609e1a0b74..609e1a0b74 100644
--- a/misc/cgo/errors/src/err3.go
+++ b/misc/cgo/errors/testdata/err3.go
diff --git a/misc/cgo/errors/src/err4.go b/misc/cgo/errors/testdata/err4.go
index 8e5f78e987..8e5f78e987 100644
--- a/misc/cgo/errors/src/err4.go
+++ b/misc/cgo/errors/testdata/err4.go
diff --git a/misc/cgo/errors/src/issue11097a.go b/misc/cgo/errors/testdata/issue11097a.go
index 028d10ce5c..028d10ce5c 100644
--- a/misc/cgo/errors/src/issue11097a.go
+++ b/misc/cgo/errors/testdata/issue11097a.go
diff --git a/misc/cgo/errors/src/issue11097b.go b/misc/cgo/errors/testdata/issue11097b.go
index b00f24fc10..b00f24fc10 100644
--- a/misc/cgo/errors/src/issue11097b.go
+++ b/misc/cgo/errors/testdata/issue11097b.go
diff --git a/misc/cgo/errors/src/issue13129.go b/misc/cgo/errors/testdata/issue13129.go
index 057bce4b82..057bce4b82 100644
--- a/misc/cgo/errors/src/issue13129.go
+++ b/misc/cgo/errors/testdata/issue13129.go
diff --git a/misc/cgo/errors/src/issue13423.go b/misc/cgo/errors/testdata/issue13423.go
index fc19157237..fc19157237 100644
--- a/misc/cgo/errors/src/issue13423.go
+++ b/misc/cgo/errors/testdata/issue13423.go
diff --git a/misc/cgo/errors/src/issue13467.go b/misc/cgo/errors/testdata/issue13467.go
index e061880dda..e061880dda 100644
--- a/misc/cgo/errors/src/issue13467.go
+++ b/misc/cgo/errors/testdata/issue13467.go
diff --git a/misc/cgo/errors/src/issue13635.go b/misc/cgo/errors/testdata/issue13635.go
index 3f38f5df4b..3f38f5df4b 100644
--- a/misc/cgo/errors/src/issue13635.go
+++ b/misc/cgo/errors/testdata/issue13635.go
diff --git a/misc/cgo/errors/src/issue13830.go b/misc/cgo/errors/testdata/issue13830.go
index ac20c82b81..ac20c82b81 100644
--- a/misc/cgo/errors/src/issue13830.go
+++ b/misc/cgo/errors/testdata/issue13830.go
diff --git a/misc/cgo/errors/src/issue14669.go b/misc/cgo/errors/testdata/issue14669.go
index 04d2bcb631..04d2bcb631 100644
--- a/misc/cgo/errors/src/issue14669.go
+++ b/misc/cgo/errors/testdata/issue14669.go
diff --git a/misc/cgo/errors/src/issue16116.go b/misc/cgo/errors/testdata/issue16116.go
index 1e01cab844..1e01cab844 100644
--- a/misc/cgo/errors/src/issue16116.go
+++ b/misc/cgo/errors/testdata/issue16116.go
diff --git a/misc/cgo/errors/src/issue16591.go b/misc/cgo/errors/testdata/issue16591.go
index 10eb8403cf..10eb8403cf 100644
--- a/misc/cgo/errors/src/issue16591.go
+++ b/misc/cgo/errors/testdata/issue16591.go
diff --git a/misc/cgo/errors/src/issue18452.go b/misc/cgo/errors/testdata/issue18452.go
index 0386d76892..0386d76892 100644
--- a/misc/cgo/errors/src/issue18452.go
+++ b/misc/cgo/errors/testdata/issue18452.go
diff --git a/misc/cgo/errors/src/issue18889.go b/misc/cgo/errors/testdata/issue18889.go
index bba6b8f9bb..bba6b8f9bb 100644
--- a/misc/cgo/errors/src/issue18889.go
+++ b/misc/cgo/errors/testdata/issue18889.go
diff --git a/misc/cgo/errors/src/issue26745.go b/misc/cgo/errors/testdata/issue26745.go
index 0e224538db..0e224538db 100644
--- a/misc/cgo/errors/src/issue26745.go
+++ b/misc/cgo/errors/testdata/issue26745.go
diff --git a/misc/cgo/errors/src/issue28069.go b/misc/cgo/errors/testdata/issue28069.go
index e19a3b45bd..e19a3b45bd 100644
--- a/misc/cgo/errors/src/issue28069.go
+++ b/misc/cgo/errors/testdata/issue28069.go
diff --git a/misc/cgo/errors/src/issue28721.go b/misc/cgo/errors/testdata/issue28721.go
index 0eb2a9271c..0eb2a9271c 100644
--- a/misc/cgo/errors/src/issue28721.go
+++ b/misc/cgo/errors/testdata/issue28721.go
diff --git a/misc/cgo/errors/src/issue7757.go b/misc/cgo/errors/testdata/issue7757.go
index 0426e9fb7e..0426e9fb7e 100644
--- a/misc/cgo/errors/src/issue7757.go
+++ b/misc/cgo/errors/testdata/issue7757.go
diff --git a/misc/cgo/errors/src/issue8442.go b/misc/cgo/errors/testdata/issue8442.go
index 60477ad345..60477ad345 100644
--- a/misc/cgo/errors/src/issue8442.go
+++ b/misc/cgo/errors/testdata/issue8442.go
diff --git a/misc/cgo/errors/src/long_double_size.go b/misc/cgo/errors/testdata/long_double_size.go
index 8b797f886a..8b797f886a 100644
--- a/misc/cgo/errors/src/long_double_size.go
+++ b/misc/cgo/errors/testdata/long_double_size.go
diff --git a/misc/cgo/errors/src/malloc.go b/misc/cgo/errors/testdata/malloc.go
index 65da0208b9..65da0208b9 100644
--- a/misc/cgo/errors/src/malloc.go
+++ b/misc/cgo/errors/testdata/malloc.go