]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/arm64: write test output to temp dir
authorCherry Zhang <cherryyz@google.com>
Wed, 25 Mar 2020 15:47:02 +0000 (11:47 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 25 Mar 2020 20:43:24 +0000 (20:43 +0000)
Write the test output to the temporary directory, not the current
directory.

May fix linux-mips64le-mengzhuo builder.

Change-Id: Ibfeb3d2879c11d498abc31df4efe776fc09a6ad6
Reviewed-on: https://go-review.googlesource.com/c/go/+/225440
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
src/cmd/internal/obj/arm64/asm_test.go

index b91f2e91ccf86109dabd273cccda119be58dd6de..1691828739b6e782f5e9050b656933f2e70afb05 100644 (file)
@@ -91,6 +91,7 @@ func TestPCALIGN(t *testing.T) {
        }
        defer os.RemoveAll(dir)
        tmpfile := filepath.Join(dir, "test.s")
+       tmpout := filepath.Join(dir, "test.o")
 
        code1 := []byte("TEXT ·foo(SB),$0-0\nMOVD $0, R0\nPCALIGN $8\nMOVD $1, R1\nRET\n")
        code2 := []byte("TEXT ·foo(SB),$0-0\nMOVD $0, R0\nPCALIGN $16\nMOVD $2, R2\nRET\n")
@@ -111,7 +112,7 @@ func TestPCALIGN(t *testing.T) {
                if err := ioutil.WriteFile(tmpfile, test.code, 0644); err != nil {
                        t.Fatal(err)
                }
-               cmd := exec.Command(testenv.GoToolPath(t), "tool", "asm", "-S", tmpfile)
+               cmd := exec.Command(testenv.GoToolPath(t), "tool", "asm", "-S", "-o", tmpout, tmpfile)
                cmd.Env = append(os.Environ(), "GOARCH=arm64", "GOOS=linux")
                out, err := cmd.CombinedOutput()
                if err != nil {