Commit 7f1dd3ae authored by Austin Clements's avatar Austin Clements

test: minor simplification to run.go

This is a little clearer, and we're about to need the .s file list in
one more place, so this will cut down on duplication.

Change-Id: I4da8bf03a0469fb97565b0841c40d505657b574e
Reviewed-on: https://go-review.googlesource.com/c/146998
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 97e4010f
...@@ -796,14 +796,14 @@ func (t *test) run() { ...@@ -796,14 +796,14 @@ func (t *test) run() {
t.err = dirErr t.err = dirErr
break break
} }
var gos []os.FileInfo var gos []string
var asms []os.FileInfo var asms []string
for _, file := range files { for _, file := range files {
switch filepath.Ext(file.Name()) { switch filepath.Ext(file.Name()) {
case ".go": case ".go":
gos = append(gos, file) gos = append(gos, filepath.Join(longdir, file.Name()))
case ".s": case ".s":
asms = append(asms, file) asms = append(asms, filepath.Join(longdir, file.Name()))
} }
} }
...@@ -812,9 +812,7 @@ func (t *test) run() { ...@@ -812,9 +812,7 @@ func (t *test) run() {
if len(asms) > 0 { if len(asms) > 0 {
cmd = append(cmd, "-asmhdr", "go_asm.h") cmd = append(cmd, "-asmhdr", "go_asm.h")
} }
for _, file := range gos { cmd = append(cmd, gos...)
cmd = append(cmd, filepath.Join(longdir, file.Name()))
}
_, err := runcmd(cmd...) _, err := runcmd(cmd...)
if err != nil { if err != nil {
t.err = err t.err = err
...@@ -823,9 +821,7 @@ func (t *test) run() { ...@@ -823,9 +821,7 @@ func (t *test) run() {
objs = append(objs, "go.o") objs = append(objs, "go.o")
if len(asms) > 0 { if len(asms) > 0 {
cmd = []string{goTool(), "tool", "asm", "-e", "-I", ".", "-o", "asm.o"} cmd = []string{goTool(), "tool", "asm", "-e", "-I", ".", "-o", "asm.o"}
for _, file := range asms { cmd = append(cmd, asms...)
cmd = append(cmd, filepath.Join(longdir, file.Name()))
}
_, err = runcmd(cmd...) _, err = runcmd(cmd...)
if err != nil { if err != nil {
t.err = err t.err = err
......
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