Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does rustdoc generate runnable binaries?

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?

like image 634
dragostis Avatar asked Feb 22 '16 07:02

dragostis


1 Answers

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.

like image 69
Simon Sapin Avatar answered Nov 16 '22 15:11

Simon Sapin