aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/pack/pack_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/pack/pack_test.go')
-rw-r--r--src/cmd/pack/pack_test.go25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/cmd/pack/pack_test.go b/src/cmd/pack/pack_test.go
index 97992059b9..cd32020501 100644
--- a/src/cmd/pack/pack_test.go
+++ b/src/cmd/pack/pack_test.go
@@ -13,7 +13,6 @@ import (
"os"
"os/exec"
"path/filepath"
- "regexp"
"runtime"
"testing"
"time"
@@ -223,15 +222,13 @@ func TestHello(t *testing.T) {
t.Fatal(err)
}
- char := findChar(t, dir)
-
run := func(args ...string) string {
return doRun(t, dir, args...)
}
run("go", "build", "cmd/pack") // writes pack binary to dir
run("go", "tool", "compile", "hello.go")
- run("./pack", "grc", "hello.a", "hello."+char)
+ run("./pack", "grc", "hello.a", "hello.o")
run("go", "tool", "link", "-o", "a.out", "hello.a")
out := run("./a.out")
if out != "hello world\n" {
@@ -297,17 +294,15 @@ func TestLargeDefs(t *testing.T) {
t.Fatal(err)
}
- char := findChar(t, dir)
-
run := func(args ...string) string {
return doRun(t, dir, args...)
}
run("go", "build", "cmd/pack") // writes pack binary to dir
run("go", "tool", "compile", "large.go")
- run("./pack", "grc", "large.a", "large."+char)
+ run("./pack", "grc", "large.a", "large.o")
run("go", "tool", "compile", "-I", ".", "main.go")
- run("go", "tool", "link", "-L", ".", "-o", "a.out", "main."+char)
+ run("go", "tool", "link", "-L", ".", "-o", "a.out", "main.o")
out := run("./a.out")
if out != "ok\n" {
t.Fatalf("incorrect output: %q, want %q", out, "ok\n")
@@ -325,20 +320,6 @@ func doRun(t *testing.T, dir string, args ...string) string {
return string(out)
}
-// findChar returns the architecture character for the go command.
-func findChar(t *testing.T, dir string) string {
- out := doRun(t, dir, "go", "env")
- re, err := regexp.Compile(`\s*GOCHAR=['"]?(\w)['"]?`)
- if err != nil {
- t.Fatal(err)
- }
- fields := re.FindStringSubmatch(out)
- if fields == nil {
- t.Fatal("cannot find GOCHAR in 'go env' output:\n", out)
- }
- return fields[1]
-}
-
// Fake implementation of files.
var helloFile = &FakeFile{