mirror of https://github.com/golang/go.git
cmd/dist: eliminate "time" special case
The registerTest function has a special case for commands that start with "time", but we don't use this case anywhere. Delete this special case and its support code. Preparation for #37486. Change-Id: Ica180417e7aa4e4fc260cb97467942bae972fdb6 Reviewed-on: https://go-review.googlesource.com/c/go/+/448801 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
40cb04c95b
commit
80d8c77a43
|
|
@ -68,7 +68,6 @@ type tester struct {
|
||||||
|
|
||||||
cgoEnabled bool
|
cgoEnabled bool
|
||||||
partial bool
|
partial bool
|
||||||
haveTime bool // the 'time' binary is available
|
|
||||||
|
|
||||||
tests []distTest
|
tests []distTest
|
||||||
timeoutScale int
|
timeoutScale int
|
||||||
|
|
@ -111,12 +110,6 @@ func (t *tester) run() {
|
||||||
|
|
||||||
t.runNames = flag.Args()
|
t.runNames = flag.Args()
|
||||||
|
|
||||||
if t.hasBash() {
|
|
||||||
if _, err := exec.LookPath("time"); err == nil {
|
|
||||||
t.haveTime = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set GOTRACEBACK to system if the user didn't set a level explicitly.
|
// Set GOTRACEBACK to system if the user didn't set a level explicitly.
|
||||||
// Since we're running tests for Go, we want as much detail as possible
|
// Since we're running tests for Go, we want as much detail as possible
|
||||||
// if something goes wrong.
|
// if something goes wrong.
|
||||||
|
|
@ -891,9 +884,6 @@ func (t *tester) isRegisteredTestName(testName string) bool {
|
||||||
|
|
||||||
func (t *tester) registerTest(name, dirBanner string, cmdline ...interface{}) {
|
func (t *tester) registerTest(name, dirBanner string, cmdline ...interface{}) {
|
||||||
bin, args := flattenCmdline(cmdline)
|
bin, args := flattenCmdline(cmdline)
|
||||||
if bin == "time" && !t.haveTime {
|
|
||||||
bin, args = args[0], args[1:]
|
|
||||||
}
|
|
||||||
if t.isRegisteredTestName(name) {
|
if t.isRegisteredTestName(name) {
|
||||||
panic("duplicate registered test name " + name)
|
panic("duplicate registered test name " + name)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue