Skip to content

Commit

Permalink
go/ssa/interp: abort long-running test when testing.Short() is set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
griesemer committed Jul 31, 2015
1 parent d89a972 commit 784fe34
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go/ssa/interp/interp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 784fe34

Please sign in to comment.