This may help to diagnose whether the hang observed in
https://build.golang.org/log/
d03db1d27515a4f7e91502e8b58bc83f6e2c04be
is related to #56180.
Updates #56180.
Updates #54773.
Change-Id: I81d37e55a35f876905ceabc103fcf0d1ff348e2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/450615
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
import (
"internal/diff"
"internal/testenv"
- "os/exec"
"sort"
"strings"
"testing"
)
func TestStd(t *testing.T) {
- out, err := exec.Command(testenv.GoToolPath(t), "list", "std").CombinedOutput()
+ out, err := testenv.Command(t, testenv.GoToolPath(t), "list", "std").CombinedOutput()
if err != nil {
t.Fatalf("%v\n%s", err, out)
}
"internal/testenv"
"io"
"os"
- "os/exec"
"strings"
"testing"
)
testenv.MustHaveGoBuild(t)
const thePackage = "math/big"
- out, err := exec.Command(testenv.GoToolPath(t), "list", "-export", "-f={{context.Compiler}}:{{.Export}}", thePackage).CombinedOutput()
+ out, err := testenv.Command(t, testenv.GoToolPath(t), "list", "-export", "-f={{context.Compiler}}:{{.Export}}", thePackage).CombinedOutput()
if err != nil {
t.Fatalf("go list %s: %v\n%s", thePackage, err, out)
}
t.Skip("This test needs gccgo")
}
- verout, err := exec.Command(gpath, "--version").CombinedOutput()
+ verout, err := testenv.Command(t, gpath, "--version").CombinedOutput()
if err != nil {
t.Logf("%s", verout)
t.Fatal(err)
ofile := filepath.Join(tmpdir, test.pkgpath+".o")
afile := filepath.Join(artmpdir, "lib"+test.pkgpath+".a")
- cmd := exec.Command(gpath, "-fgo-pkgpath="+test.pkgpath, "-c", "-o", ofile, gofile)
+ cmd := testenv.Command(t, gpath, "-fgo-pkgpath="+test.pkgpath, "-c", "-o", ofile, gofile)
out, err := cmd.CombinedOutput()
if err != nil {
t.Logf("%s", out)
runImporterTest(t, imp, initmap, &test)
- cmd = exec.Command("ar", "cr", afile, ofile)
+ cmd = testenv.Command(t, "ar", "cr", afile, ofile)
out, err = cmd.CombinedOutput()
if err != nil {
t.Logf("%s", out)
"internal/goexperiment"
"internal/testenv"
"os"
- "os/exec"
"path"
"path/filepath"
"runtime"
importcfgfile := filepath.Join(outdirname, basename) + ".importcfg"
testenv.WriteImportcfg(t, importcfgfile, packagefiles)
pkgpath := path.Join("testdata", basename)
- cmd := exec.Command(testenv.GoToolPath(t), "tool", "compile", "-p", pkgpath, "-D", "testdata", "-importcfg", importcfgfile, "-o", outname, filename)
+ cmd := testenv.Command(t, testenv.GoToolPath(t), "tool", "compile", "-p", pkgpath, "-D", "testdata", "-importcfg", importcfgfile, "-o", outname, filename)
cmd.Dir = dirname
out, err := cmd.CombinedOutput()
if err != nil {