aboutsummaryrefslogtreecommitdiff
path: root/src/testing/run_example.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/run_example.go')
-rw-r--r--src/testing/run_example.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/testing/run_example.go b/src/testing/run_example.go
index 10bde49e5b..4dc83f7d32 100644
--- a/src/testing/run_example.go
+++ b/src/testing/run_example.go
@@ -43,6 +43,7 @@ func runExample(eg InternalExample) (ok bool) {
outC <- buf.String()
}()
+ finished := false
start := time.Now()
// Clean up in a deferred call so we can recover if the example panics.
@@ -55,10 +56,11 @@ func runExample(eg InternalExample) (ok bool) {
out := <-outC
err := recover()
- ok = eg.processRunResult(out, timeSpent, err)
+ ok = eg.processRunResult(out, timeSpent, finished, err)
}()
// Run example.
eg.F()
+ finished = true
return
}