Skip to content
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

rustdoc --test ignores --target #44404

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

rustdoc --test ignores --target #44404

asomers opened this issue Sep 8, 2017 · 2 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@asomers
Copy link
Contributor

asomers commented Sep 8, 2017

rustdoc's --target option works when building documentation, but it seems to be ignored when running tests. At the very least, using both options together should result in an error. Ideally, rustdoc would invoke a cross compiler in this case. It can be useful, for example, to execute doc tests in 32-bit mode on a 64-bit host.

To reproduce: Running rustdoc --target=itanium-multics-gnu --test <more valid options> should result in an error, but instead the doc tests run fine.

@alexcrichton alexcrichton added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Sep 8, 2017
@dianpopa
Copy link

I have an inquiry regarding running documentation tests when using a target different than the default one.
My project is intended to run with target x86_64-unknown-linux-musl which is specified in .cargo/config. When I do a simple cargo test the Doc-tests are not run. However, If I remove it from there, I am able to see the Doc-tests being run. I am compiling on an x86 machine. Also, If I keep the musl target and I specifically run cargo test like cargo test --target x86_64-unknown-linux-gnu the Doc-tests are successfully run. I am guessing I stumbled upon #4471 which seems to be the expected behavior. However, to me this is not exactly cross-compilation as I am on an x86 host and trying to obtain a musl enabled binary for the same type of architecture (i.e. x86).
What is your opinion on this? Is this a bug?

@ehuss
Copy link
Contributor

ehuss commented Jun 14, 2020

Closing in favor of the tracking issues #64245 and rust-lang/cargo#7040.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants