]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/objdump: ensure that test executable files are distinct
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 13 May 2019 20:15:10 +0000 (13:15 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 13 May 2019 20:36:11 +0000 (20:36 +0000)
This fixes test failures introduced by CL 176901.

Change-Id: I133299ba3be3a15ced076c95e4833ba6070d7eb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/176903
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/objdump/objdump_test.go

index 8d73c016c603a95f6a95ab3f9de0b25744d53b8a..b24371ddea567b04b2aeec3afb8fcdb8c3669c53 100644 (file)
@@ -5,6 +5,7 @@
 package main
 
 import (
+       "crypto/md5"
        "flag"
        "fmt"
        "go/build"
@@ -101,7 +102,8 @@ func testDisasm(t *testing.T, printCode bool, flags ...string) {
                goarch = f[1]
        }
 
-       hello := filepath.Join(tmp, "hello.exe")
+       hash := md5.Sum([]byte(fmt.Sprintf("%v-%v", flags, printCode)))
+       hello := filepath.Join(tmp, fmt.Sprintf("hello-%x.exe", hash))
        args := []string{"build", "-o", hello}
        args = append(args, flags...)
        args = append(args, "testdata/fmthello.go")