Reputation: 4581
In test functions that take *testing.T or *testing.B as a parameter, it's easy to log a line:
func TestMyFunc(t *testing.T) {
t.Log("hello testing"
...
}
How do you do this in a setup function that takes *testing.M as a parameter?
func TestMain(m *testing.M) {
???
}
Upvotes: 4
Views: 816
Reputation: 618
A look at the documentation of package testing shows that type testing.M
has no logging method associated with it. You should do logging using package log (as already mentioned in the comments).
Upvotes: 3