Skip to content

Commit

Permalink
Add missing T.Deadline
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly authored and deadprogram committed Jul 23, 2024
1 parent b318a94 commit 61d36fb
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 61d36fb

Please sign in to comment.