From 784fe34e06a7ec996e4213c496cdcd76a6ad3df5 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 31 Jul 2015 14:13:37 -0700 Subject: [PATCH] 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 --- go/ssa/interp/interp_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/go/ssa/interp/interp_test.go b/go/ssa/interp/interp_test.go index 9c9f891a..c914c6df 100644 --- a/go/ssa/interp/interp_test.go +++ b/go/ssa/interp/interp_test.go @@ -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) }