aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLaurent Demailly <[email protected]>2024-07-21 10:55:54 -0700
committerRon Evans <[email protected]>2024-07-23 22:23:35 +0200
commit61d36fb3f8b29cd412ea98443be7691933af07b7 (patch)
treed4854d6a8f702241a93a0a1e1a9c3ecb8664c74b
parentb318a941a4d5ffd22ff227606b9e74822901c8ef (diff)
downloadtinygo-61d36fb3f8b29cd412ea98443be7691933af07b7.tar.gz
tinygo-61d36fb3f8b29cd412ea98443be7691933af07b7.zip
Add missing T.Deadline
-rw-r--r--src/testing/testing.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go
index 8429e9221..9058892d2 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -463,10 +463,23 @@ func (t *T) Run(name string, f func(t *T)) bool {
return !sub.failed
}
+// Deadline reports the time at which the test binary will have
+// exceeded the timeout specified by the -timeout flag.
+//
+// The ok result is false if the -timeout flag indicates “no timeout” (0).
+// For now tinygo always return 0, false.
+//
+// Not Implemented.
+func (t *T) Deadline() (deadline time.Time, ok bool) {
+ deadline = t.context.deadline
+ return deadline, !deadline.IsZero()
+}
+
// testContext holds all fields that are common to all tests. This includes
// synchronization primitives to run at most *parallel tests.
type testContext struct {
- match *matcher
+ match *matcher
+ deadline time.Time
}
func newTestContext(m *matcher) *testContext {