It would be nice to be able to enable / disable doc tests as a CLI flag and a local (.cargo/config) option.
This was motivated because doctests don't work for cross-compiled testing right now, but we should also just fix that.
This was motivated because doctests don't work for cross-compiled testing right now, but we should also just fix that.
What is the bug for that? I am hitting this when cross-compiling to i686 from x64_64 on the same OS.
We may not actually have a bug open (I don't recall one off-hand), but if we did it'd be rattling around in rust-lang/rust somewhere
I am running into this as well, would be really nice to get a fix here even outside the context of cross compiling (though that is where I am hitting an issue). Sometimes I just don't want to run doctests because they are slow, currently broken, etc. without making it a permanent option.
I have a lot of tests and it takes a long time to recompile them all. So it would be nice to have a flag that runs just the doctests.
I'm aware of cargo test --lib and cargo --test TEST but none of them reach the doctests subset.
I think @alexcrichton implemented this in #2578.
@jooert --doc tests only the doctests but there isn't a way to disable them. (AFAIK)
Oops, looks like that's exactly what --lib does 🤦♂️
Shall we close this ticket?
cargo test --doccargo test --libThe only thing left is disabling doc tests in .cargo/config, but is there much request for that? Do we want to include that?
Sounds good to me!
~@jooert
--doctests only the doctests but there isn't a way to _disable_ them. (AFAIK)~Oops, looks like that's exactly what
--libdoes 🤦♂️
Not quite, --lib doesn't seem to run the 'integration' tests from the integ library.
I found my way here because my IDE cannot attach a debugger when multiple binaries are produced. I believe doc tests must be in a separate binary?
So I have no way to run all tests, including the integ tests from the tests directory, and attach my IDE's debugging functionality. What I need is a --no-doc flag.
Most helpful comment
I have a lot of tests and it takes a long time to recompile them all. So it would be nice to have a flag that runs just the doctests.
I'm aware of
cargo test --libandcargo --test TESTbut none of them reach the doctests subset.