Commit c3836ed0 authored by Rémy Oudompheng's avatar Rémy Oudompheng

test: make rundir match compiledir/errorcheckdir.

This allows test/dwarf to be supported by run.go.

Update #4139.

R=golang-dev, bradfitz, iant
CC=golang-dev
https://golang.org/cl/7064067
parent bef4cb47
// rundir
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// See issue 2241 and issue 1878: dwarf include stack size
// issues in linker.
package ignored
......@@ -459,20 +459,19 @@ func (t *test) run() {
// Compile all files in the directory in lexicographic order.
// then link as if the last file is the main package and run it
longdir := filepath.Join(cwd, t.goDirName())
files, err := goDirFiles(longdir)
pkgs, err := goDirPackages(longdir)
if err != nil {
t.err = err
return
}
var gofile os.FileInfo
for _, gofile = range files {
_, err := compileInDir(runcmd, longdir, gofile.Name())
for i, gofiles := range pkgs {
_, err := compileInDir(runcmd, longdir, gofiles...)
if err != nil {
t.err = err
return
}
}
err = linkFile(runcmd, gofile.Name())
if i == len(pkgs)-1 {
err = linkFile(runcmd, gofiles[0])
if err != nil {
t.err = err
return
......@@ -485,6 +484,8 @@ func (t *test) run() {
if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() {
t.err = fmt.Errorf("incorrect output\n%s", out)
}
}
}
case "build":
_, err := runcmd("go", "build", "-o", "a.exe", long)
......@@ -726,27 +727,6 @@ var skipOkay = map[string]bool{
"rotate.go": true,
"sigchld.go": true,
"sinit.go": true,
"dwarf/main.go": true,
"dwarf/z1.go": true,
"dwarf/z10.go": true,
"dwarf/z11.go": true,
"dwarf/z12.go": true,
"dwarf/z13.go": true,
"dwarf/z14.go": true,
"dwarf/z15.go": true,
"dwarf/z16.go": true,
"dwarf/z17.go": true,
"dwarf/z18.go": true,
"dwarf/z19.go": true,
"dwarf/z2.go": true,
"dwarf/z20.go": true,
"dwarf/z3.go": true,
"dwarf/z4.go": true,
"dwarf/z5.go": true,
"dwarf/z6.go": true,
"dwarf/z7.go": true,
"dwarf/z8.go": true,
"dwarf/z9.go": true,
"fixedbugs/bug248.go": true, // combines errorcheckdir and rundir in the same dir.
"fixedbugs/bug302.go": true, // tests both .$O and .a imports.
"fixedbugs/bug313.go": true, // errorcheckdir with failures in the middle.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment