diff --git a/tests/testsuite/cross_compile.rs b/tests/testsuite/cross_compile.rs index 3b234a764..a781729a7 100644 --- a/tests/testsuite/cross_compile.rs +++ b/tests/testsuite/cross_compile.rs @@ -437,45 +437,6 @@ fn no_cross_doctests() { .run(); } -#[cargo_test] -fn cross_doctests() { - if cross_compile::disabled() || !cross_compile::can_run_on_host() || !is_nightly() { - return; - } - - let p = project() - .file( - "src/lib.rs", - r#" - //! ``` - //! extern crate foo; - //! assert!(true); - //! ``` - "#, - ) - .build(); - - let target = cross_compile::alternate(); - - // This tests the library and runs the doc tests. - p.cargo("test -v -Z doctest-xcompile --target") - .arg(&target) - .masquerade_as_nightly_cargo() - .with_stderr(&format!( - "\ -[COMPILING] foo v0.0.1 ([CWD]) -[RUNNING] `rustc --crate-name foo [..] -[RUNNING] `rustc --crate-name foo [..]--test[..] -[FINISHED] test [unoptimized + debuginfo] target(s) in [..] -[RUNNING] `[CWD]/target/{triple}/debug/deps/foo-[..][EXE]` -[DOCTEST] foo -[RUNNING] `rustdoc [..] -", - triple = target - )) - .run(); -} - #[cargo_test] fn simple_cargo_run() { if !cross_compile::can_run_on_host() { diff --git a/tests/testsuite/custom_target.rs b/tests/testsuite/custom_target.rs index 3970bc8d4..75aba8a99 100644 --- a/tests/testsuite/custom_target.rs +++ b/tests/testsuite/custom_target.rs @@ -51,6 +51,12 @@ fn custom_target_minimal() { p.cargo("build --lib --target custom-target.json -v").run(); p.cargo("build --lib --target src/../custom-target.json -v") .run(); + + // Ensure that the correct style of flag is passed to --target with doc tests. + p.cargo("test --doc --target src/../custom-target.json -v -Zdoctest-xcompile") + .masquerade_as_nightly_cargo() + .with_stderr_contains("[RUNNING] `rustdoc [..]--target [..]foo/custom-target.json[..]") + .run(); } #[cargo_test]