From 1daaf680d0870d7765a2a1486e68ca06491eb51e Mon Sep 17 00:00:00 2001 From: Will Crichton Date: Wed, 13 Apr 2022 17:44:48 -0700 Subject: [PATCH] Update tests if scraping is only on nightly --- src/cargo/core/compiler/unit_dependencies.rs | 3 +- src/cargo/core/manifest.rs | 13 +- tests/testsuite/artifact_dep.rs | 16 ++- tests/testsuite/build_script.rs | 2 - tests/testsuite/collisions.rs | 4 - tests/testsuite/doc.rs | 129 ++++--------------- tests/testsuite/features2.rs | 1 - tests/testsuite/glob_targets.rs | 30 +---- tests/testsuite/multitarget.rs | 6 +- tests/testsuite/profile_targets.rs | 4 - tests/testsuite/rustdoc.rs | 9 -- tests/testsuite/rustdocflags.rs | 1 - 12 files changed, 54 insertions(+), 164 deletions(-) diff --git a/src/cargo/core/compiler/unit_dependencies.rs b/src/cargo/core/compiler/unit_dependencies.rs index 467120f77fbf..4bd8aedf2b25 100644 --- a/src/cargo/core/compiler/unit_dependencies.rs +++ b/src/cargo/core/compiler/unit_dependencies.rs @@ -712,7 +712,7 @@ fn compute_deps_doc( if state.ws.unit_needs_doc_scrape(unit) { for scrape_unit in state.scrape_units.iter() { deps_of(scrape_unit, state, unit_for)?; - ret.push(new_unit_dep_with_profile( + ret.push(new_unit_dep( state, scrape_unit, &scrape_unit.pkg, @@ -720,7 +720,6 @@ fn compute_deps_doc( unit_for, scrape_unit.kind, scrape_unit.mode, - scrape_unit.profile.clone(), IS_NO_ARTIFACT_DEP, )?); } diff --git a/src/cargo/core/manifest.rs b/src/cargo/core/manifest.rs index f5d9efcd95aa..f10998537ab0 100644 --- a/src/cargo/core/manifest.rs +++ b/src/cargo/core/manifest.rs @@ -808,12 +808,13 @@ impl Target { self.inner.edition } pub fn doc_scrape_examples(&self) -> bool { - self.inner.doc_scrape_examples.unwrap_or_else(|| { - matches!( - self.kind(), - TargetKind::Lib(..) | TargetKind::ExampleBin | TargetKind::ExampleLib(..) - ) - }) + !self.for_host() + && self.inner.doc_scrape_examples.unwrap_or_else(|| { + matches!( + self.kind(), + TargetKind::Lib(..) | TargetKind::ExampleBin | TargetKind::ExampleLib(..) + ) + }) } pub fn benched(&self) -> bool { self.inner.benched diff --git a/tests/testsuite/artifact_dep.rs b/tests/testsuite/artifact_dep.rs index 3b28ad0aa28c..260083351db2 100644 --- a/tests/testsuite/artifact_dep.rs +++ b/tests/testsuite/artifact_dep.rs @@ -4,8 +4,8 @@ use cargo_test_support::compare::match_exact; use cargo_test_support::registry::Package; use cargo_test_support::{ - basic_bin_manifest, basic_manifest, cross_compile, project, publish, registry, rustc_host, - Project, + basic_bin_manifest, basic_manifest, cross_compile, is_nightly, project, publish, registry, + rustc_host, Project, }; #[cargo_test] @@ -1991,6 +1991,11 @@ target = "target""#, #[cargo_test] fn doc_lib_true() { + if !is_nightly() { + // nightly rustdoc invokes scrape examples, which is not stable + return; + } + let p = project() .file( "Cargo.toml", @@ -2019,6 +2024,7 @@ fn doc_lib_true() { "\ [COMPILING] bar v0.0.1 ([CWD]/bar) [DOCUMENTING] bar v0.0.1 ([CWD]/bar) +[SCRAPING] foo v0.0.1 ([CWD]) [DOCUMENTING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -2046,6 +2052,11 @@ fn doc_lib_true() { #[cargo_test] fn rustdoc_works_on_libs_with_artifacts_and_lib_false() { + if !is_nightly() { + // nightly rustdoc invokes scrape examples, which is not stable + return; + } + let p = project() .file( "Cargo.toml", @@ -2094,6 +2105,7 @@ fn rustdoc_works_on_libs_with_artifacts_and_lib_false() { .with_stderr( "\ [COMPILING] bar v0.5.0 ([CWD]/bar) +[SCRAPING] foo v0.0.1 ([CWD]) [DOCUMENTING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", diff --git a/tests/testsuite/build_script.rs b/tests/testsuite/build_script.rs index bcbcbb621418..d0ef3a2e727a 100644 --- a/tests/testsuite/build_script.rs +++ b/tests/testsuite/build_script.rs @@ -1317,8 +1317,6 @@ fn testing_and_such() { p.cargo("doc -v") .with_stderr( "\ -[SCRAPING] foo v0.5.0 ([CWD]) -[RUNNING] `rustdoc [..]` [DOCUMENTING] foo v0.5.0 ([CWD]) [RUNNING] `rustdoc [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] diff --git a/tests/testsuite/collisions.rs b/tests/testsuite/collisions.rs index 5fb7fac692a0..e9fd3085f2a1 100644 --- a/tests/testsuite/collisions.rs +++ b/tests/testsuite/collisions.rs @@ -199,7 +199,6 @@ fn collision_doc_multiple_versions() { [CHECKING] bar v1.0.0 [DOCUMENTING] bar v2.0.0 [FINISHED] [..] -[SCRAPING] foo v0.1.0 [..] [DOCUMENTING] foo v0.1.0 [..] ", ) @@ -379,7 +378,6 @@ fn collision_doc_profile_split() { [CHECKING] common v1.0.0 [DOCUMENTING] common v1.0.0 [DOCUMENTING] pm v0.1.0 [..] -[SCRAPING] foo v0.1.0 [..] [DOCUMENTING] foo v0.1.0 [..] [FINISHED] [..] ", @@ -426,7 +424,6 @@ the same path; see . [DOCUMENTING] bar v1.0.0 [..] [DOCUMENTING] bar v1.0.0 [CHECKING] bar v1.0.0 -[SCRAPING] foo v0.1.0 [..] [DOCUMENTING] foo v0.1.0 [..] [FINISHED] [..] ", @@ -541,7 +538,6 @@ the same path; see . [CHECKING] foo-macro v1.0.0 [DOCUMENTING] foo-macro v1.0.0 [CHECKING] abc v1.0.0 [..] -[SCRAPING] foo-macro v1.0.0 [..] [DOCUMENTING] foo-macro v1.0.0 [..] [DOCUMENTING] abc v1.0.0 [..] [FINISHED] [..] diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index b37f053e9e15..04c5cb50488c 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -67,7 +67,6 @@ fn doc_twice() { p.cargo("doc") .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([CWD]) [DOCUMENTING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -102,7 +101,6 @@ fn doc_deps() { "\ [..] bar v0.0.1 ([CWD]/bar) [..] bar v0.0.1 ([CWD]/bar) -[SCRAPING] foo v0.0.1 ([CWD]) [DOCUMENTING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -151,7 +149,6 @@ fn doc_no_deps() { .with_stderr( "\ [CHECKING] bar v0.0.1 ([CWD]/bar) -[SCRAPING] foo v0.0.1 ([CWD]) [DOCUMENTING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -284,7 +281,6 @@ Colliding filename is: [ROOT]/foo/target/doc/foo_lib/index.html The targets should have unique names. This is a known bug where multiple crates with the same name use the same path; see . -[SCRAPING] bar v0.1.0 ([ROOT]/foo/bar) [DOCUMENTING] bar v0.1.0 ([ROOT]/foo/bar) [DOCUMENTING] foo v0.1.0 ([ROOT]/foo/foo) [FINISHED] [..] @@ -400,7 +396,6 @@ fn doc_lib_bin_same_name_documents_lib() { p.cargo("doc") .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([CWD]) [DOCUMENTING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -436,7 +431,6 @@ fn doc_lib_bin_same_name_documents_lib_when_requested() { p.cargo("doc --lib") .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([CWD]) [DOCUMENTING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -482,7 +476,6 @@ The targets should have unique names. This is a known bug where multiple crates with the same name use the same path; see . [CHECKING] foo v0.0.1 ([CWD]) -[SCRAPING] foo v0.0.1 ([CWD]) [DOCUMENTING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -528,7 +521,6 @@ The targets should have unique names. This is a known bug where multiple crates with the same name use the same path; see . [CHECKING] foo v0.0.1 ([CWD]) -[SCRAPING] foo v0.0.1 ([CWD]) [DOCUMENTING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -563,7 +555,7 @@ fn doc_lib_bin_example_same_name_documents_named_example_when_requested() { "examples/ex1.rs", r#" //! Example1 documentation - pub fn x() { foo::foo(); } + pub fn x() { f(); } "#, ) .build(); @@ -609,14 +601,14 @@ fn doc_lib_bin_example_same_name_documents_examples_when_requested() { "examples/ex1.rs", r#" //! Example1 documentation - pub fn example1() { foo::foo(); } + pub fn example1() { f(); } "#, ) .file( "examples/ex2.rs", r#" //! Example2 documentation - pub fn example2() { foo::foo(); } + pub fn example2() { f(); } "#, ) .build(); @@ -703,15 +695,13 @@ fn doc_all_exclude() { .file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("bar/src/lib.rs", "pub fn bar() {}") .file("baz/Cargo.toml", &basic_manifest("baz", "0.1.0")) - .file("baz/src/lib.rs", "pub fn baz() {}") + .file("baz/src/lib.rs", "pub fn baz() { break_the_build(); }") .build(); p.cargo("doc --workspace --exclude baz") .with_stderr_does_not_contain("[DOCUMENTING] baz v0.1.0 [..]") - .with_stderr_unordered( + .with_stderr( "\ -[SCRAPING] baz v0.1.0 ([..]) -[SCRAPING] bar v0.1.0 ([..]) [DOCUMENTING] bar v0.1.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -732,15 +722,13 @@ fn doc_all_exclude_glob() { .file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("bar/src/lib.rs", "pub fn bar() {}") .file("baz/Cargo.toml", &basic_manifest("baz", "0.1.0")) - .file("baz/src/lib.rs", "pub fn baz() {}") + .file("baz/src/lib.rs", "pub fn baz() { break_the_build(); }") .build(); p.cargo("doc --workspace --exclude '*z'") .with_stderr_does_not_contain("[DOCUMENTING] baz v0.1.0 [..]") - .with_stderr_unordered( + .with_stderr( "\ -[SCRAPING] bar v0.1.0 ([..]) -[SCRAPING] baz v0.1.0 ([..]) [DOCUMENTING] bar v0.1.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -930,8 +918,6 @@ fn doc_release() { p.cargo("doc --release -v") .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([..]) -[RUNNING] `rustdoc [..] src/lib.rs [..]` [DOCUMENTING] foo v0.0.1 ([..]) [RUNNING] `rustdoc [..] src/lib.rs [..]` [FINISHED] release [optimized] target(s) in [..] @@ -1021,7 +1007,6 @@ fn features() { "\ [COMPILING] bar v0.0.1 [..] [DOCUMENTING] bar v0.0.1 [..] -[SCRAPING] foo v0.0.1 [..] [DOCUMENTING] foo v0.0.1 [..] [FINISHED] [..] ", @@ -1036,7 +1021,6 @@ fn features() { "\ [COMPILING] bar v0.0.1 [..] [DOCUMENTING] bar v0.0.1 [..] -[SCRAPING] foo v0.0.1 [..] [DOCUMENTING] foo v0.0.1 [..] [FINISHED] [..] ", @@ -1212,15 +1196,13 @@ fn doc_virtual_manifest_one_project() { .file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("bar/src/lib.rs", "pub fn bar() {}") .file("baz/Cargo.toml", &basic_manifest("baz", "0.1.0")) - .file("baz/src/lib.rs", "pub fn baz() {}") + .file("baz/src/lib.rs", "pub fn baz() { break_the_build(); }") .build(); p.cargo("doc -p bar") .with_stderr_does_not_contain("[DOCUMENTING] baz v0.1.0 [..]") - .with_stderr_unordered( + .with_stderr( "\ -[SCRAPING] baz v0.1.0 ([..]) -[SCRAPING] bar v0.1.0 ([..]) [DOCUMENTING] bar v0.1.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -1239,17 +1221,15 @@ fn doc_virtual_manifest_glob() { "#, ) .file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0")) - .file("bar/src/lib.rs", "pub fn bar() {}") + .file("bar/src/lib.rs", "pub fn bar() { break_the_build(); }") .file("baz/Cargo.toml", &basic_manifest("baz", "0.1.0")) .file("baz/src/lib.rs", "pub fn baz() {}") .build(); p.cargo("doc -p '*z'") .with_stderr_does_not_contain("[DOCUMENTING] bar v0.1.0 [..]") - .with_stderr_unordered( + .with_stderr( "\ -[SCRAPING] baz v0.1.0 ([..]) -[SCRAPING] bar v0.1.0 ([..]) [DOCUMENTING] baz v0.1.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -1298,7 +1278,6 @@ This is a known bug where multiple crates with the same name use the same path; see . [DOCUMENTING] bar v0.1.0 [CHECKING] bar v0.1.0 -[SCRAPING] bar v0.1.0 [..] [DOCUMENTING] bar v0.1.0 [..] [FINISHED] [..] ", @@ -1668,7 +1647,6 @@ fn doc_cap_lints() { [UPDATING] git repository `[..]` [DOCUMENTING] a v0.5.0 ([..]) [CHECKING] a v0.5.0 ([..]) -[SCRAPING] foo v0.0.1 ([..]) [DOCUMENTING] foo v0.0.1 ([..]) [FINISHED] dev [..] ", @@ -2026,8 +2004,6 @@ fn crate_versions() { p.cargo("doc -v") .with_stderr( "\ -[SCRAPING] foo v1.2.4 [..] -[RUNNING] `rustdoc --crate-type lib --crate-name foo src/lib.rs [..]--crate-version 1.2.4` [DOCUMENTING] foo v1.2.4 [..] [RUNNING] `rustdoc --crate-type lib --crate-name foo src/lib.rs [..]--crate-version 1.2.4` [FINISHED] [..] @@ -2327,6 +2303,10 @@ LLVM version: 9.0 #[cargo_test] fn doc_fingerprint_unusual_behavior() { + if !is_nightly() { + // nightly rustdoc invokes scrape examples, which is not stable + return; + } // Checks for some unusual circumstances with clearing the doc directory. if !symlink_supported() { return; @@ -2355,8 +2335,7 @@ fn doc_fingerprint_unusual_behavior() { p.change_file("src/lib.rs", "// changed"); p.cargo("doc") .with_stderr( - "[SCRAPING] foo [..]\n\ - [DOCUMENTING] foo [..]\n\ + "[DOCUMENTING] foo [..]\n\ [FINISHED] [..]", ) .run(); @@ -2530,33 +2509,6 @@ fn scrape_examples_complex_reverse_dependencies() { p.cargo("doc").masquerade_as_nightly_cargo().run(); } -#[cargo_test] -fn scrape_examples_conflicting_reverse_deps() { - if !is_nightly() { - // scrape examples is unstable - return; - } - - let p = project() - .file( - "Cargo.toml", - r#" - [package] - name = "foo" - version = "0.0.1" - authors = [] - "#, - ) - .file("src/lib.rs", "") - .file("examples/a.rs", "fn main() {}") - .file("benches/a.rs", "fn main() {}") - .build(); - - p.cargo("doc").masquerade_as_nightly_cargo().run(); - - println!("{}", p.root().display()); -} - #[cargo_test] fn scrape_examples_crate_with_dash() { if !is_nightly() { @@ -2659,53 +2611,20 @@ fn scrape_examples_configure_profile() { assert!(doc_html.contains("More examples")); } -#[cargo_test] -fn scrape_examples_configure_profile() { - if !is_nightly() { - // -Z rustdoc-scrape-examples is unstable - return; - } - - let p = project() - .file( - "Cargo.toml", - r#" - [package] - name = "foo" - version = "0.0.1" - authors = [] - - [profile.dev] - panic = "abort" - "#, - ) - .file("examples/ex.rs", "fn main() { foo::foo(); }") - .file("src/lib.rs", "pub fn foo() {}\npub fn bar() { foo(); }") - .build(); - - p.cargo("doc -Zunstable-options -Z rustdoc-scrape-examples=all") - .masquerade_as_nightly_cargo() - .run(); - - let doc_html = p.read_file("target/doc/foo/fn.foo.html"); - assert!(doc_html.contains("Examples found in repository")); - assert!(doc_html.contains("More examples")); -} - #[cargo_test] fn scrape_examples_issue_10545() { if !is_nightly() { - // -Z rustdoc-scrape-examples is unstable + // scrape examples is unstable return; } let p = project() .file( "Cargo.toml", - r#" + r#" [workspace] resolver = "2" - members = ["a", "b"] + members = ["a", "b"] "#, ) .file( @@ -2739,9 +2658,7 @@ fn scrape_examples_issue_10545() { .file("b/src/lib.rs", "") .build(); - p.cargo("doc -Zunstable-options -Z rustdoc-scrape-examples=all") - .masquerade_as_nightly_cargo() - .run(); + p.cargo("doc").masquerade_as_nightly_cargo().run(); } #[cargo_test] @@ -2774,8 +2691,6 @@ fn lib_before_bin() { p.cargo("doc -v") .with_stderr( "\ -[SCRAPING] foo [..] -[RUNNING] `rustdoc --crate-type lib --crate-name foo src/lib.rs [..] --scrape-examples-output-path [..]` [DOCUMENTING] foo [..] [RUNNING] `rustdoc --crate-type lib --crate-name foo src/lib.rs [..] [RUNNING] `rustdoc --crate-type bin --crate-name somebin src/bin/somebin.rs [..] @@ -2827,7 +2742,6 @@ fn doc_lib_false() { .with_stderr( "\ [CHECKING] bar v0.1.0 [..] -[SCRAPING] foo v0.1.0 [..] [CHECKING] foo v0.1.0 [..] [DOCUMENTING] foo v0.1.0 [..] [FINISHED] [..] @@ -2875,7 +2789,6 @@ fn doc_lib_false_dep() { .with_stderr( "\ [CHECKING] bar v0.1.0 [..] -[SCRAPING] foo v0.1.0 [..] [DOCUMENTING] foo v0.1.0 [..] [FINISHED] [..] ", @@ -2915,6 +2828,8 @@ fn doc_check_cfg_features() { .masquerade_as_nightly_cargo() .with_stderr( "\ +[SCRAPING] foo v0.1.0 [..] +[RUNNING] `rustdoc [..] --check-cfg 'values(feature, \"default\", \"f_a\", \"f_b\")' [..] [DOCUMENTING] foo v0.1.0 [..] [RUNNING] `rustdoc [..] --check-cfg 'values(feature, \"default\", \"f_a\", \"f_b\")' [..] [FINISHED] [..] diff --git a/tests/testsuite/features2.rs b/tests/testsuite/features2.rs index 93ba1c726e10..af94073da22b 100644 --- a/tests/testsuite/features2.rs +++ b/tests/testsuite/features2.rs @@ -1909,7 +1909,6 @@ fn doc_optional() { [DOWNLOADED] bar v1.0.0 [..] [DOCUMENTING] bar v1.0.0 [CHECKING] bar v1.0.0 -[SCRAPING] foo v0.1.0 [..] [DOCUMENTING] foo v0.1.0 [..] [FINISHED] [..] ", diff --git a/tests/testsuite/glob_targets.rs b/tests/testsuite/glob_targets.rs index d5d4ab921273..643572e42a9b 100644 --- a/tests/testsuite/glob_targets.rs +++ b/tests/testsuite/glob_targets.rs @@ -132,12 +132,8 @@ fn check_test() { fn doc_bin() { full_project() .cargo("doc -v --bin 'bi*1'") - .with_stderr_unordered( + .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc --crate-type bin --crate-name example2 [..]` -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc --crate-type bin --crate-name example1 [..]` [DOCUMENTING] foo v0.0.1 ([CWD]) [RUNNING] `rustdoc --crate-type bin --crate-name bin1 [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] @@ -406,12 +402,8 @@ fn install_bin() { fn rustdoc_example() { full_project() .cargo("rustdoc -v --example 'ex*1'") - .with_stderr_unordered( + .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc --crate-type bin --crate-name example2 [..]` -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc --crate-type bin --crate-name example1 [..]` [DOCUMENTING] foo v0.0.1 ([CWD]) [RUNNING] `rustdoc --crate-type bin --crate-name example1 [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] @@ -424,12 +416,8 @@ fn rustdoc_example() { fn rustdoc_bin() { full_project() .cargo("rustdoc -v --bin 'bi*1'") - .with_stderr_unordered( + .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc --crate-type bin --crate-name example2 [..]` -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc --crate-type bin --crate-name example1 [..]` [DOCUMENTING] foo v0.0.1 ([CWD]) [RUNNING] `rustdoc --crate-type bin --crate-name bin1 [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] @@ -442,12 +430,8 @@ fn rustdoc_bin() { fn rustdoc_bench() { full_project() .cargo("rustdoc -v --bench 'be*1'") - .with_stderr_unordered( + .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc --crate-type bin --crate-name example2 [..]` -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc --crate-type bin --crate-name example1 [..]` [DOCUMENTING] foo v0.0.1 ([CWD]) [RUNNING] `rustdoc --crate-type bin --crate-name bench1 [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] @@ -460,12 +444,8 @@ fn rustdoc_bench() { fn rustdoc_test() { full_project() .cargo("rustdoc -v --test 'te*1'") - .with_stderr_unordered( + .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc --crate-type bin --crate-name example2 [..]` -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc --crate-type bin --crate-name example1 [..]` [DOCUMENTING] foo v0.0.1 ([CWD]) [RUNNING] `rustdoc --crate-type bin --crate-name test1 [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] diff --git a/tests/testsuite/multitarget.rs b/tests/testsuite/multitarget.rs index d4aced728f5a..96f7aebf979b 100644 --- a/tests/testsuite/multitarget.rs +++ b/tests/testsuite/multitarget.rs @@ -1,6 +1,6 @@ //! Tests for multiple `--target` flags to subcommands -use cargo_test_support::{basic_manifest, cross_compile, project, rustc_host}; +use cargo_test_support::{basic_manifest, cross_compile, is_nightly, project, rustc_host}; #[cargo_test] fn double_target_rejected() { @@ -144,6 +144,10 @@ fn simple_run() { #[cargo_test] fn simple_doc() { + if !is_nightly() { + // nightly rustdoc invokes scrape examples, which is not stable + return; + } if cross_compile::disabled() { return; } diff --git a/tests/testsuite/profile_targets.rs b/tests/testsuite/profile_targets.rs index 05bfae616984..74d54385ff14 100644 --- a/tests/testsuite/profile_targets.rs +++ b/tests/testsuite/profile_targets.rs @@ -651,10 +651,6 @@ fn profile_selection_doc() { [RUNNING] `[..] rustc --crate-name build_script_build build.rs [..]--crate-type bin --emit=[..]link[..]-C codegen-units=5 -C debuginfo=2 [..] [RUNNING] `[..]target/debug/build/foo-[..]/build-script-build` [foo 0.0.1] foo custom build PROFILE=debug DEBUG=true OPT_LEVEL=0 -[RUNNING] `rustdoc --crate-type lib --crate-name foo [..] -[RUNNING] `rustdoc --crate-type bin --crate-name ex1 [..] -[RUNNING] `[..] rustc --crate-name bar [..] -[RUNNING] `[..] rustc --crate-name foo [..] [DOCUMENTING] foo [..] [RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..] [FINISHED] dev [unoptimized + debuginfo] [..] diff --git a/tests/testsuite/rustdoc.rs b/tests/testsuite/rustdoc.rs index 6c9d0c2684fe..5650f3e0a5bf 100644 --- a/tests/testsuite/rustdoc.rs +++ b/tests/testsuite/rustdoc.rs @@ -9,9 +9,6 @@ fn rustdoc_simple() { p.cargo("rustdoc -v") .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..]\ - --scrape-examples-output-path [..]` [DOCUMENTING] foo v0.0.1 ([CWD]) [RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..]\ -o [CWD]/target/doc \ @@ -30,8 +27,6 @@ fn rustdoc_args() { p.cargo("rustdoc -v -- --cfg=foo") .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..]` [DOCUMENTING] foo v0.0.1 ([CWD]) [RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..]\ -o [CWD]/target/doc \ @@ -84,8 +79,6 @@ fn rustdoc_foo_with_bar_dependency() { "\ [CHECKING] bar v0.0.1 ([..]) [RUNNING] `rustc [..]bar/src/lib.rs [..]` -[SCRAPING] foo v0.0.1 ([CWD]) -[RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..]` [DOCUMENTING] foo v0.0.1 ([CWD]) [RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..]\ -o [CWD]/target/doc \ @@ -149,8 +142,6 @@ fn rustdoc_same_name_documents_lib() { p.cargo("rustdoc -v -- --cfg=foo") .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([..]) -[RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..]` [DOCUMENTING] foo v0.0.1 ([..]) [RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..]\ -o [CWD]/target/doc \ diff --git a/tests/testsuite/rustdocflags.rs b/tests/testsuite/rustdocflags.rs index e5079b6b5aa2..44175de40c11 100644 --- a/tests/testsuite/rustdocflags.rs +++ b/tests/testsuite/rustdocflags.rs @@ -54,7 +54,6 @@ fn rerun() { .env("RUSTDOCFLAGS", "--cfg=bar") .with_stderr( "\ -[SCRAPING] foo v0.0.1 ([..]) [DOCUMENTING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ",