Open Phoenix500526 opened 1 year ago
As said in https://github.com/taiki-e/cargo-llvm-cov/issues/273, tokio::test refers ::core::prelude::v1::test, so it's not working with coverage_helper.
The most desirable fix is to change libtest so that the test attribute gets no_coverage, and the second most desirable is to make the change on the tokio side.
This problem may have been resolved by tokio-macros 2.3.0, which includes https://github.com/tokio-rs/tokio/pull/6497.
And so, what are we supposed to write in the tests using #[tokio::test]
?
EDIT : ok I understand, the version 2.3.0 of tokio-macros may have solved it without any change. I’ve updated to tokio 1.40.0 and the problem remains.
Hi, @taiki-e.
Currently, the implementation of coverage_helper replaces
std::test
withcoverage_helper::test
. However, this approach doesn't work fortokio::test
. Given thattokio::test
is widely used, shall we supporttokio::test
in this crate?IMO, we can provide a
tokio
module incoverage_helper
, like:What do you think? If this approach is feasible, I can do some contributions.