Skip to content

Can't cross-compile doc tests with Cargo #4471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
asomers opened this issue Sep 5, 2017 · 2 comments
Closed

Can't cross-compile doc tests with Cargo #4471

asomers opened this issue Sep 5, 2017 · 2 comments

Comments

@asomers
Copy link

asomers commented Sep 5, 2017

I have a project that uses unit, functional, and doc tests. When I run “cargo test”, all three sets of tests execute. But when I cross-compile, only the unit and functional tests do. The output makes no mention of Doc-tests at all. I can't find anything in the cargo docs that suggests why this should be impossible. For the case where the host is a 64-bit system and the target is the 32-bit ABI of the same architecture, it ought to work. Indeed, the unit and functional tests run and pass. Only the doc tests fail to build. My host is x86_64 FreeBSD and I’m trying to cross test i686 FreeBSD.

> cargo --version
cargo 0.21.0 (5b4b8b2ae 2017-08-12)
> freebsd-version 
11.0-RELEASE-p9
> cargo test --target=i686-unknown-freebsd -v
@alexcrichton
Copy link
Member

This is currently intentional as while Cargo has infrastructure for running cross-compiled tests and handling all that I don't believe this is implemented and/or handled in rustdoc. I'm not sure if rustdoc --test --target ... will work as expected.

@asomers
Copy link
Author

asomers commented Sep 8, 2017

Good explanation, @alexcrichton . It looks like rustdoc ignores --target when used with --test. I've opened a separate issue for that.
rust-lang/rust#44404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants