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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 97e4010f
......@@ -796,14 +796,14 @@ func (t *test) run() {
t.err = dirErr
break
}
var gos []os.FileInfo
var asms []os.FileInfo
var gos []string
var asms []string
for _, file := range files {
switch filepath.Ext(file.Name()) {
case ".go":
gos = append(gos, file)
gos = append(gos, filepath.Join(longdir, file.Name()))
case ".s":
asms = append(asms, file)
asms = append(asms, filepath.Join(longdir, file.Name()))
}
}
......@@ -812,9 +812,7 @@ func (t *test) run() {
if len(asms) > 0 {
cmd = append(cmd, "-asmhdr", "go_asm.h")
}
for _, file := range gos {
cmd = append(cmd, filepath.Join(longdir, file.Name()))
}
cmd = append(cmd, gos...)
_, err := runcmd(cmd...)
if err != nil {
t.err = err
......@@ -823,9 +821,7 @@ func (t *test) run() {
objs = append(objs, "go.o")
if len(asms) > 0 {
cmd = []string{goTool(), "tool", "asm", "-e", "-I", ".", "-o", "asm.o"}
for _, file := range asms {
cmd = append(cmd, filepath.Join(longdir, file.Name()))
}
cmd = append(cmd, asms...)
_, err = runcmd(cmd...)
if err != nil {
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