]> Cypherpunks repositories - gostls13.git/commit
runtime: run debuglog tests when debuglog tag is *not* set
authorAustin Clements <austin@google.com>
Tue, 23 Jul 2024 21:28:09 +0000 (17:28 -0400)
committerAustin Clements <austin@google.com>
Tue, 30 Jul 2024 13:10:59 +0000 (13:10 +0000)
commit3e1bda08fba871157c3c91a44437b7bd266371c1
tree5b06b1f45b7eb1b03cc4967d90b7269c56fec6c0
parent548158c4a57580e8c8bd0e9b2f91d03b31efa879
runtime: run debuglog tests when debuglog tag is *not* set

Currently, the debuglog tests only run when the debuglog build tag is
set because, until the last few CLs, all of debuglog was compiled away
without that build tag. This causes two annoying problems:

1. The tests basically never run, because we don't regularly test this
configuration.

2. If you do turn on the debuglog build tag, it's probably because
you're adding debuglogs into the runtime, which are very likely to
mess up these tests, so you wind up disabling the tests and they,
again, don't get coverage.

Now we've set things up so the debuglog implementation is always
accessible, if you ask nicely enough. So we can switch these tests to
run when the tag is *not* set, and turn off when the tag *is* set (and
you're probably adding actual log statements).

Change-Id: Ib68d7a5022d4f5db96e9c7c8010cbef21d11fe11
Reviewed-on: https://go-review.googlesource.com/c/go/+/600697
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
src/runtime/debuglog.go
src/runtime/debuglog_test.go
src/runtime/export_debuglog_test.go