]> Cypherpunks repositories - gostls13.git/commitdiff
test: minor simplification to run.go
authorAustin Clements <austin@google.com>
Fri, 2 Nov 2018 02:04:02 +0000 (22:04 -0400)
committerAustin Clements <austin@google.com>
Mon, 12 Nov 2018 20:46:39 +0000 (20:46 +0000)
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: Brad Fitzpatrick <bradfitz@golang.org>
test/run.go

index b6421d5e419c435c52757a1c4767b2422cee0838..6a050b0049d7c13714e51f0ec5271a6f96b7ef22 100644 (file)
@@ -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