Does rustdoc generate runnable binaries?

697 views Asked by At

I'm trying to run kcov on a Rust project. This works really well for usual tests, but I haven't been able to figure out how to make it find doc tests.

Does rustdoc create any binaries that I can pass to kcov to run coverage on?

1

There are 1 answers

2
Simon Sapin On

Rustdoc compiles binaries in a temporary directory and runs them immediately:

https://github.com/rust-lang/rust/blob/acdd3b9f5a/src/librustdoc/test.rs#L248-L292

I think the TempDir destructor removes the temporary directory and its contents when the function end. There doesn’t seem to be any way to get at the binaries in order to run them in kcov.