runtime: add TestCgoDLLImports

The test is a simple reproduction of issue 9356.

Update #8948.
Update #9356.

Change-Id: Ia77bc36d12ed0c3c4a8b1214cade8be181c9ad55
Reviewed-on: https://go-review.googlesource.com/7618
Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
Alex Brainman 2015-03-16 15:46:22 +11:00
parent 21aad02f9d
commit 9b69196958
2 changed files with 60 additions and 1 deletions

View file

@ -72,7 +72,14 @@ func executeTest(t *testing.T, templ string, data interface{}, extra ...string)
}
for i := 0; i < len(extra); i += 2 {
if err := ioutil.WriteFile(filepath.Join(dir, extra[i]), []byte(extra[i+1]), 0666); err != nil {
fname := extra[i]
contents := extra[i+1]
if d, _ := filepath.Split(fname); d != "" {
if err := os.Mkdir(filepath.Join(dir, d), 0755); err != nil {
t.Fatal(err)
}
}
if err := ioutil.WriteFile(filepath.Join(dir, fname), []byte(contents), 0666); err != nil {
t.Fatal(err)
}
}