crate-ci / escargot

Cargo API written in Paris
docs.rs/cargo
Apache License 2.0
42 stars 14 forks source link

Programmatic support for doctests? #27

Open epage opened 5 years ago

epage commented 5 years ago

Doctests are tricky because they are creating code, and binaries, on the fly.

This is important for

epage commented 5 years ago

As suspected, cargo test delegates to rustdoc for doctests, populating all the hard-to-discover flags :(

https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/cargo_test.rs#L129

epage commented 5 years ago

The core logic seems to be at https://github.com/rust-lang/rust/blob/master/src/librustdoc/test.rs#L182

epage commented 5 years ago

brson's work on skeptic might be reused to cover both skeptic and doctests

See https://github.com/budziq/rust-skeptic/issues/18#issuecomment-464269889

epage commented 5 years ago

Looks like taurplin has taken a crack at solving the doctest problem

See https://github.com/xd009642/tarpaulin/issues/13