mirror of
https://github.com/golang/go
synced 2024-11-18 19:54:44 -07:00
go/ssa/interp: abort long-running test when testing.Short() is set
This should help on slower machines. For golang/go#11811. Change-Id: Ibb5d5bf0f6cedcda6437ef0ee3fc1f4ba89dab90 Reviewed-on: https://go-review.googlesource.com/13009 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
d89a972634
commit
784fe34e06
@ -291,7 +291,12 @@ func success(exitcode int, output string) error {
|
||||
// TestTestdataFiles runs the interpreter on testdata/*.go.
|
||||
func TestTestdataFiles(t *testing.T) {
|
||||
var failures []string
|
||||
start := time.Now()
|
||||
for _, input := range testdataTests {
|
||||
if testing.Short() && time.Since(start) > 30*time.Second {
|
||||
printFailures(failures)
|
||||
t.Skipf("timeout - aborting test")
|
||||
}
|
||||
if !run(t, "testdata"+slash, input, success) {
|
||||
failures = append(failures, input)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user