diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs index 5b9ffde6089..55fcb0df301 100644 --- a/tests/testsuite/alt_registry.rs +++ b/tests/testsuite/alt_registry.rs @@ -59,10 +59,9 @@ fn depend_on_alt_registry() { [UPDATING] registry `{reg}` [DOWNLOADING] bar v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url(), reg = registry::alt_registry() )).run(); @@ -71,14 +70,13 @@ fn depend_on_alt_registry() { // Don't download a second time p.cargo("build") .masquerade_as_nightly_cargo() - .with_stderr(&format!( + .with_stderr( "\ [COMPILING] bar v0.0.1 (registry `file://[..]`) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() - )).run(); + ).run(); } #[test] @@ -116,10 +114,9 @@ fn depend_on_alt_registry_depends_on_same_registry_no_index() { [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url(), reg = registry::alt_registry() )).run(); } @@ -159,10 +156,9 @@ fn depend_on_alt_registry_depends_on_same_registry() { [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url(), reg = registry::alt_registry() )).run(); } @@ -203,10 +199,9 @@ fn depend_on_alt_registry_depends_on_crates_io() { [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url(), alt_reg = registry::alt_registry(), reg = registry::registry() )).run(); @@ -238,14 +233,13 @@ fn registry_and_path_dep_works() { p.cargo("build") .masquerade_as_nightly_cargo() - .with_stderr(&format!( + .with_stderr( "\ -[COMPILING] bar v0.0.1 ({dir}/bar) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] bar v0.0.1 (CWD/bar) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() - )).run(); + ).run(); } #[test] @@ -371,7 +365,7 @@ fn alt_registry_and_crates_io_deps() { .with_stderr_contains("[DOWNLOADING] alt_reg_dep v0.1.0 (registry `file://[..]`)") .with_stderr_contains("[COMPILING] alt_reg_dep v0.1.0 (registry `file://[..]`)") .with_stderr_contains("[COMPILING] crates_io_dep v0.0.1") - .with_stderr_contains(&format!("[COMPILING] foo v0.0.1 ({})", p.url())) + .with_stderr_contains("[COMPILING] foo v0.0.1 (CWD)") .with_stderr_contains("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s") .run(); } diff --git a/tests/testsuite/bad_config.rs b/tests/testsuite/bad_config.rs index 02ef9ae2b2a..e4675a4815c 100644 --- a/tests/testsuite/bad_config.rs +++ b/tests/testsuite/bad_config.rs @@ -641,7 +641,7 @@ fn unused_keys() { .with_stderr( "\ warning: unused manifest key: target.foo.bar -[COMPILING] foo v0.1.0 (file:///[..]) +[COMPILING] foo v0.1.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); diff --git a/tests/testsuite/bench.rs b/tests/testsuite/bench.rs index 01a18e0422a..d523aba1c78 100644 --- a/tests/testsuite/bench.rs +++ b/tests/testsuite/bench.rs @@ -39,10 +39,9 @@ fn cargo_bench_simple() { p.cargo("bench") .with_stderr(&format!( "\ -[COMPILING] foo v0.5.0 ({}) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE]", - p.url() )).with_stdout_contains("test bench_hello ... bench: [..]") .run(); } @@ -79,12 +78,11 @@ fn bench_bench_implicit() { p.cargo("bench --benches") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE] [RUNNING] target/release/deps/mybench-[..][EXE] ", - dir = p.url() )).with_stdout_contains("test run2 ... bench: [..]") .run(); } @@ -121,11 +119,10 @@ fn bench_bin_implicit() { p.cargo("bench --bins") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE] ", - dir = p.url() )).with_stdout_contains("test run1 ... bench: [..]") .run(); } @@ -154,11 +151,10 @@ fn bench_tarname() { p.cargo("bench --bench bin2") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/bin2-[..][EXE] ", - dir = p.url() )).with_stdout_contains("test run2 ... bench: [..]") .run(); } @@ -219,11 +215,10 @@ fn cargo_bench_verbose() { p.cargo("bench -v hello") .with_stderr(&format!( "\ -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc [..] src/main.rs [..]` [FINISHED] release [optimized] target(s) in [..] [RUNNING] `[..]target/release/deps/foo-[..][EXE] hello --bench`", - url = p.url() )).with_stdout_contains("test bench_hello ... bench: [..]") .run(); } @@ -310,10 +305,9 @@ fn cargo_bench_failing_test() { .with_stdout_contains("test bench_hello ...[..]") .with_stderr_contains(format!( "\ -[COMPILING] foo v0.5.0 ({})[..] +[COMPILING] foo v0.5.0 (CWD)[..] [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE]", - p.url() )).with_either_contains( "[..]thread '[..]' panicked at 'assertion failed: `(left == right)`[..]", ).with_either_contains("[..]left: `\"hello\"`[..]") @@ -378,11 +372,10 @@ fn bench_with_lib_dep() { p.cargo("bench") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE] [RUNNING] target/release/deps/baz-[..][EXE]", - p.url() )).with_stdout_contains("test lib_bench ... bench: [..]") .with_stdout_contains("test bin_bench ... bench: [..]") .run(); @@ -440,10 +433,9 @@ fn bench_with_deep_lib_dep() { .with_stderr(&format!( "\ [COMPILING] foo v0.0.1 ([..]) -[COMPILING] bar v0.0.1 ({dir}) +[COMPILING] bar v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/bar-[..][EXE]", - dir = p.url() )).with_stdout_contains("test bar_bench ... bench: [..]") .run(); } @@ -494,11 +486,10 @@ fn external_bench_explicit() { p.cargo("bench") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE] [RUNNING] target/release/deps/bench-[..][EXE]", - p.url() )).with_stdout_contains("test internal_bench ... bench: [..]") .with_stdout_contains("test external_bench ... bench: [..]") .run(); @@ -539,11 +530,10 @@ fn external_bench_implicit() { p.cargo("bench") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE] [RUNNING] target/release/deps/external-[..][EXE]", - p.url() )).with_stdout_contains("test internal_bench ... bench: [..]") .with_stdout_contains("test external_bench ... bench: [..]") .run(); @@ -615,11 +605,10 @@ automatically infer them to be a target, such as in subfolders. For more information on this warning you can consult https://github.com/rust-lang/cargo/issues/5330 -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE] ", - p.url() )).run(); } @@ -660,10 +649,9 @@ fn pass_through_command_line() { p.cargo("bench bar") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE]", - dir = p.url() )).with_stdout_contains("test bar ... bench: [..]") .run(); @@ -748,11 +736,10 @@ fn lib_bin_same_name() { p.cargo("bench") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE] [RUNNING] target/release/deps/foo-[..][EXE]", - p.url() )).with_stdout_contains_n("test [..] ... bench: [..]", 2) .run(); } @@ -795,11 +782,10 @@ fn lib_with_standard_name() { p.cargo("bench") .with_stderr(&format!( "\ -[COMPILING] syntax v0.0.1 ({dir}) +[COMPILING] syntax v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/syntax-[..][EXE] [RUNNING] target/release/deps/bench-[..][EXE]", - dir = p.url() )).with_stdout_contains("test foo_bench ... bench: [..]") .with_stdout_contains("test bench ... bench: [..]") .run(); @@ -845,10 +831,9 @@ fn lib_with_standard_name2() { p.cargo("bench") .with_stderr(&format!( "\ -[COMPILING] syntax v0.0.1 ({dir}) +[COMPILING] syntax v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/syntax-[..][EXE]", - dir = p.url() )).with_stdout_contains("test bench ... bench: [..]") .run(); } @@ -916,16 +901,15 @@ fn bench_dylib() { p.cargo("bench -v") .with_stderr(&format!( "\ -[COMPILING] bar v0.0.1 ({dir}/bar) +[COMPILING] bar v0.0.1 (CWD/bar) [RUNNING] [..] -C opt-level=3 [..] -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] [..] -C opt-level=3 [..] [RUNNING] [..] -C opt-level=3 [..] [RUNNING] [..] -C opt-level=3 [..] [FINISHED] release [optimized] target(s) in [..] [RUNNING] `[..]target/release/deps/foo-[..][EXE] --bench` [RUNNING] `[..]target/release/deps/bench-[..][EXE] --bench`", - dir = p.url() )).with_stdout_contains_n("test foo ... bench: [..]", 2) .run(); @@ -933,12 +917,11 @@ fn bench_dylib() { p.cargo("bench -v") .with_stderr(&format!( "\ -[FRESH] bar v0.0.1 ({dir}/bar) -[FRESH] foo v0.0.1 ({dir}) +[FRESH] bar v0.0.1 (CWD/bar) +[FRESH] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] `[..]target/release/deps/foo-[..][EXE] --bench` [RUNNING] `[..]target/release/deps/bench-[..][EXE] --bench`", - dir = p.url() )).with_stdout_contains_n("test foo ... bench: [..]", 2) .run(); } @@ -974,10 +957,9 @@ fn bench_twice_with_build_cmd() { p.cargo("bench") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE]", - dir = p.url() )).with_stdout_contains("test foo ... bench: [..]") .run(); @@ -1059,15 +1041,13 @@ fn bench_with_examples() { p.cargo("bench -v") .with_stderr(&format!( "\ -[COMPILING] foo v6.6.6 ({url}) +[COMPILING] foo v6.6.6 (CWD) [RUNNING] `rustc [..]` [RUNNING] `rustc [..]` [RUNNING] `rustc [..]` [FINISHED] release [optimized] target(s) in [..] -[RUNNING] `{dir}/target/release/deps/foo-[..][EXE] --bench` -[RUNNING] `{dir}/target/release/deps/testb1-[..][EXE] --bench`", - dir = p.root().display(), - url = p.url() +[RUNNING] `CWD/target/release/deps/foo-[..][EXE] --bench` +[RUNNING] `CWD/target/release/deps/testb1-[..][EXE] --bench`", )).with_stdout_contains("test bench_bench1 ... bench: [..]") .with_stdout_contains("test bench_bench2 ... bench: [..]") .run(); diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index 0453946b94d..e43ba99f9d7 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -804,13 +804,12 @@ fn cargo_compile_with_dep_name_mismatch() { p.cargo("build") .with_status(101) - .with_stderr(&format!( + .with_stderr( r#"error: no matching package named `notquitebar` found -location searched: {proj_dir}/bar -required by package `foo v0.0.1 ({proj_dir})` +location searched: CWD/bar +required by package `foo v0.0.1 (CWD)` "#, - proj_dir = p.url() - )).run(); + ).run(); } #[test] @@ -1021,10 +1020,9 @@ fn main(){ .with_stderr(format!( "\ [COMPILING] present_dep v1.2.3 -[COMPILING] foo v0.1.0 ({url}) +[COMPILING] foo v0.1.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] Running `[..]`", - url = p2.url() )).with_stdout("1.2.3") .run(); } @@ -1166,7 +1164,7 @@ fn compile_offline_while_transitive_dep_not_cached() { error: no matching package named `baz` found location searched: registry `[..]` required by package `bar v0.1.0` - ... which is depended on by `foo v0.0.1 ([..]/foo)` + ... which is depended on by `foo v0.0.1 (CWD)` As a reminder, you're using offline mode (-Z offline) \ which can sometimes cause surprising resolution failures, \ if this error is too confusing you may with to retry \ @@ -1262,24 +1260,22 @@ fn cargo_default_env_metadata_env_var() { p.cargo("build -v") .with_stderr(&format!( "\ -[COMPILING] bar v0.0.1 ({url}/bar) +[COMPILING] bar v0.0.1 (CWD/bar) [RUNNING] `rustc --crate-name bar bar/src/lib.rs --crate-type dylib \ --emit=dep-info,link \ -C prefer-dynamic -C debuginfo=2 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps` -[COMPILING] foo v0.0.1 ({url}) + -L dependency=CWD/target/debug/deps` +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc --crate-name foo src/lib.rs --crate-type lib \ --emit=dep-info,link -C debuginfo=2 \ -C metadata=[..] \ -C extra-filename=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps \ - --extern bar={dir}/target/debug/deps/{prefix}bar{suffix}` + -L dependency=CWD/target/debug/deps \ + --extern bar=CWD/target/debug/deps/{prefix}bar{suffix}` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", - dir = p.root().display(), - url = p.url(), prefix = env::consts::DLL_PREFIX, suffix = env::consts::DLL_SUFFIX, )).run(); @@ -1291,25 +1287,23 @@ fn cargo_default_env_metadata_env_var() { .env("__CARGO_DEFAULT_LIB_METADATA", "stable") .with_stderr(&format!( "\ -[COMPILING] bar v0.0.1 ({url}/bar) +[COMPILING] bar v0.0.1 (CWD/bar) [RUNNING] `rustc --crate-name bar bar/src/lib.rs --crate-type dylib \ --emit=dep-info,link \ -C prefer-dynamic -C debuginfo=2 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps` -[COMPILING] foo v0.0.1 ({url}) + -L dependency=CWD/target/debug/deps` +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc --crate-name foo src/lib.rs --crate-type lib \ --emit=dep-info,link -C debuginfo=2 \ -C metadata=[..] \ -C extra-filename=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps \ - --extern bar={dir}/target/debug/deps/{prefix}bar-[..]{suffix}` + -L dependency=CWD/target/debug/deps \ + --extern bar=CWD/target/debug/deps/{prefix}bar-[..]{suffix}` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.root().display(), - url = p.url(), prefix = env::consts::DLL_PREFIX, suffix = env::consts::DLL_SUFFIX, )).run(); @@ -1376,9 +1370,7 @@ fn crate_env_vars() { p.cargo("build -v").run(); println!("bin"); - p.process(&p.bin("foo")) - .with_stdout(&format!("0-5-1 @ alpha.1 in {}\n", p.root().display())) - .run(); + p.process(&p.bin("foo")).with_stdout("0-5-1 @ alpha.1 in CWD").run(); println!("test"); p.cargo("test -v").run(); @@ -1559,8 +1551,8 @@ fn self_dependency() { .with_status(101) .with_stderr( "\ -[ERROR] cyclic package dependency: package `test v0.0.0 ([..])` depends on itself. Cycle: -package `test v0.0.0 ([..]foo)`", +[ERROR] cyclic package dependency: package `test v0.0.0 (CWD)` depends on itself. Cycle: +package `test v0.0.0 (CWD)`", ).run(); } @@ -1623,18 +1615,16 @@ fn lto_build() { p.cargo("build -v --release") .with_stderr(&format!( "\ -[COMPILING] test v0.0.0 ({url}) +[COMPILING] test v0.0.0 (CWD) [RUNNING] `rustc --crate-name test src/main.rs --crate-type bin \ --emit=dep-info,link \ -C opt-level=3 \ -C lto \ -C metadata=[..] \ - --out-dir {dir}/target/release/deps \ - -L dependency={dir}/target/release/deps` + --out-dir CWD/target/release/deps \ + -L dependency=CWD/target/release/deps` [FINISHED] release [optimized] target(s) in [..] ", - dir = p.root().display(), - url = p.url(), )).run(); } @@ -1644,16 +1634,14 @@ fn verbose_build() { p.cargo("build -v") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({url}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc --crate-name foo src/lib.rs --crate-type lib \ --emit=dep-info,link -C debuginfo=2 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.root().display(), - url = p.url(), )).run(); } @@ -1663,17 +1651,15 @@ fn verbose_release_build() { p.cargo("build -v --release") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({url}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc --crate-name foo src/lib.rs --crate-type lib \ --emit=dep-info,link \ -C opt-level=3 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/release/deps` + -L dependency=CWD/target/release/deps` [FINISHED] release [optimized] target(s) in [..] ", - dir = p.root().display(), - url = p.url(), )).run(); } @@ -1711,7 +1697,7 @@ fn verbose_release_build_deps() { p.cargo("build -v --release") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.0 ({url}/foo) +[COMPILING] foo v0.0.0 (CWD/foo) [RUNNING] `rustc --crate-name foo foo/src/lib.rs \ --crate-type dylib --crate-type rlib \ --emit=dep-info,link \ @@ -1719,20 +1705,18 @@ fn verbose_release_build_deps() { -C opt-level=3 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/release/deps` -[COMPILING] test v0.0.0 ({url}) + -L dependency=CWD/target/release/deps` +[COMPILING] test v0.0.0 (CWD) [RUNNING] `rustc --crate-name test src/lib.rs --crate-type lib \ --emit=dep-info,link \ -C opt-level=3 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/release/deps \ - --extern foo={dir}/target/release/deps/{prefix}foo{suffix} \ - --extern foo={dir}/target/release/deps/libfoo.rlib` + -L dependency=CWD/target/release/deps \ + --extern foo=CWD/target/release/deps/{prefix}foo{suffix} \ + --extern foo=CWD/target/release/deps/libfoo.rlib` [FINISHED] release [optimized] target(s) in [..] ", - dir = p.root().display(), - url = p.url(), prefix = env::consts::DLL_PREFIX, suffix = env::consts::DLL_SUFFIX )).run(); @@ -2048,10 +2032,9 @@ fn lib_with_standard_name() { p.cargo("build") .with_stderr(&format!( "\ -[COMPILING] syntax v0.0.1 ({dir}) +[COMPILING] syntax v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); } @@ -2159,10 +2142,9 @@ fn freshness_ignores_excluded() { foo.cargo("build") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.0 ({url}) +[COMPILING] foo v0.0.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = foo.url() )).run(); // Smoke test to make sure it doesn't compile again @@ -2211,20 +2193,18 @@ fn rebuild_preserves_out_dir() { .env("FIRST", "1") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.0 ({url}) +[COMPILING] foo v0.0.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = foo.url() )).run(); File::create(&foo.root().join("src/bar.rs")).unwrap(); foo.cargo("build") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.0 ({url}) +[COMPILING] foo v0.0.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = foo.url() )).run(); } @@ -2618,11 +2598,13 @@ fn cyclic_deps_rejected() { ).file("a/src/lib.rs", "") .build(); - p.cargo("build -v").with_status(101) - .with_stderr( -r#"[ERROR] cyclic package dependency: package `a v0.0.1 ([..])` depends on itself. Cycle: -package `a v0.0.1 ([..]a)` - ... which is depended on by `foo v0.0.1 ([..]foo)`[..]"#).run(); + p.cargo("build -v") + .with_status(101) + .with_stderr( +"[ERROR] cyclic package dependency: package `a v0.0.1 (CWD/a)` depends on itself. Cycle: +package `a v0.0.1 (CWD/a)` + ... which is depended on by `foo v0.0.1 (CWD)`", + ).run(); } #[test] diff --git a/tests/testsuite/build_lib.rs b/tests/testsuite/build_lib.rs index 611422ce6bb..fa324ab3e56 100644 --- a/tests/testsuite/build_lib.rs +++ b/tests/testsuite/build_lib.rs @@ -1,22 +1,4 @@ -use support::{basic_bin_manifest, basic_manifest, project, Project}; - -fn verbose_output_for_lib(p: &Project) -> String { - format!( - "\ -[COMPILING] {name} v{version} ({url}) -[RUNNING] `rustc --crate-name {name} src/lib.rs --crate-type lib \ - --emit=dep-info,link -C debuginfo=2 \ - -C metadata=[..] \ - --out-dir [..] \ - -L dependency={dir}/target/debug/deps` -[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] -", - dir = p.root().display(), - url = p.url(), - name = "foo", - version = "0.0.1" - ) -} +use support::{basic_bin_manifest, basic_manifest, project}; #[test] fn build_lib_only() { @@ -26,8 +8,16 @@ fn build_lib_only() { .build(); p.cargo("build --lib -v") - .with_stderr(verbose_output_for_lib(&p)) - .run(); + .with_stderr( + "\ +[COMPILING] foo v0.0.1 (CWD) +[RUNNING] `rustc --crate-name foo src/lib.rs --crate-type lib \ + --emit=dep-info,link -C debuginfo=2 \ + -C metadata=[..] \ + --out-dir [..] \ + -L dependency=CWD/target/debug/deps` +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", + ).run(); } #[test] diff --git a/tests/testsuite/build_script.rs b/tests/testsuite/build_script.rs index d6c76307dd8..cb4ad7f04cd 100644 --- a/tests/testsuite/build_script.rs +++ b/tests/testsuite/build_script.rs @@ -31,12 +31,11 @@ fn custom_build_script_failed() { .with_status(101) .with_stderr(&format!( "\ -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc --crate-name build_script_build build.rs --crate-type bin [..]` [RUNNING] `[..]/build-script-build` -[ERROR] failed to run custom build command for `foo v0.5.0 ({url})` +[ERROR] failed to run custom build command for `foo v0.5.0 (CWD)` process didn't exit successfully: `[..]/build-script-build` (exit code: 101)", - url = p.url() )).run(); } @@ -182,9 +181,8 @@ fn custom_build_script_wrong_rustc_flags() { .with_status(101) .with_stderr_contains(&format!( "\ - [ERROR] Only `-l` and `-L` flags are allowed in build script of `foo v0.5.0 ({})`: \ + [ERROR] Only `-l` and `-L` flags are allowed in build script of `foo v0.5.0 (CWD)`: \ `-aaa -bbb`", - p.url() )).run(); } @@ -192,7 +190,9 @@ fn custom_build_script_wrong_rustc_flags() { #[test] fn custom_build_script_rustc_flags() { let p = project() - .file("Cargo.toml", r#" + .file( + "Cargo.toml", + r#" [project] name = "bar" @@ -201,40 +201,43 @@ fn custom_build_script_rustc_flags() { [dependencies.foo] path = "foo" - "#) - .file("src/main.rs", "fn main() {}") - .file("foo/Cargo.toml", r#" + "#, + ).file("src/main.rs", "fn main() {}") + .file( + "foo/Cargo.toml", + r#" [project] name = "foo" version = "0.5.0" authors = ["wycats@example.com"] build = "build.rs" - "#) - .file("foo/src/lib.rs", r#" - "#) - .file("foo/build.rs", r#" + "#, + ).file("foo/src/lib.rs", "") + .file( + "foo/build.rs", + r#" fn main() { println!("cargo:rustc-flags=-l nonexistinglib -L /dummy/path1 -L /dummy/path2"); } - "#) - .build(); + "#, + ).build(); // TODO: TEST FAILS BECAUSE OF WRONG STDOUT (but otherwise, the build works) - p.cargo("build --verbose").with_status(101) - .with_stderr(&format!("\ -[COMPILING] bar v0.5.0 ({url}) -[RUNNING] `rustc --crate-name test {dir}{sep}src{sep}lib.rs --crate-type lib -C debuginfo=2 \ + p.cargo("build --verbose") + .with_status(101) + .with_stderr( + "\ +[COMPILING] bar v0.5.0 (CWD) +[RUNNING] `rustc --crate-name test CWD/src/lib.rs --crate-type lib -C debuginfo=2 \ -C metadata=[..] \ -C extra-filename=-[..] \ - --out-dir {dir}{sep}target \ + --out-dir CWD/target \ --emit=dep-info,link \ - -L {dir}{sep}target \ - -L {dir}{sep}target{sep}deps` -", sep = path::SEP, -dir = p.root().display(), -url = p.url(), -)).run(); + -L CWD/target \ + -L CWD/target/deps` +", + ).run(); } */ @@ -257,7 +260,7 @@ fn links_no_build_cmd() { .with_status(101) .with_stderr( "\ -[ERROR] package `foo v0.5.0 (file://[..])` specifies that it links to `a` but does \ +[ERROR] package `foo v0.5.0 (CWD)` specifies that it links to `a` but does \ not have a custom build script ", ).run(); @@ -548,7 +551,7 @@ fn only_rerun_build_script() { p.cargo("build -v") .with_stderr( "\ -[COMPILING] foo v0.5.0 (file://[..]) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `[..]/build-script-build` [RUNNING] `rustc --crate-name foo [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] @@ -648,7 +651,7 @@ fn testing_and_such() { p.cargo("test -vj1") .with_stderr( "\ -[COMPILING] foo v0.5.0 (file://[..]) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `[..]/build-script-build` [RUNNING] `rustc --crate-name foo [..]` [RUNNING] `rustc --crate-name foo [..]` @@ -663,7 +666,7 @@ fn testing_and_such() { p.cargo("doc -v") .with_stderr( "\ -[DOCUMENTING] foo v0.5.0 (file://[..]) +[DOCUMENTING] foo v0.5.0 (CWD) [RUNNING] `rustdoc [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -677,7 +680,7 @@ fn testing_and_such() { p.cargo("run") .with_stderr( "\ -[COMPILING] foo v0.5.0 (file://[..]) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/foo[EXE]` ", @@ -743,7 +746,7 @@ fn propagation_of_l_flags() { .with_stderr_contains( "\ [RUNNING] `rustc --crate-name a [..] -L bar[..]-L foo[..]` -[COMPILING] foo v0.5.0 (file://[..]) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc --crate-name foo [..] -L bar -L foo` ", ).run(); @@ -812,7 +815,7 @@ fn propagation_of_l_flags_new() { .with_stderr_contains( "\ [RUNNING] `rustc --crate-name a [..] -L bar[..]-L foo[..]` -[COMPILING] foo v0.5.0 (file://[..]) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc --crate-name foo [..] -L bar -L foo` ", ).run(); @@ -847,9 +850,9 @@ fn build_deps_simple() { p.cargo("build -v") .with_stderr( "\ -[COMPILING] a v0.5.0 (file://[..]) +[COMPILING] a v0.5.0 (CWD/a) [RUNNING] `rustc --crate-name a [..]` -[COMPILING] foo v0.5.0 (file://[..]) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc [..] build.rs [..] --extern a=[..]` [RUNNING] `[..]/foo-[..]/build-script-build` [RUNNING] `rustc --crate-name foo [..]` @@ -947,9 +950,9 @@ fn build_cmd_with_a_build_cmd() { p.cargo("build -v") .with_stderr( "\ -[COMPILING] b v0.5.0 (file://[..]) +[COMPILING] b v0.5.0 (CWD/b) [RUNNING] `rustc --crate-name b [..]` -[COMPILING] a v0.5.0 (file://[..]) +[COMPILING] a v0.5.0 (CWD/a) [RUNNING] `rustc [..] a/build.rs [..] --extern b=[..]` [RUNNING] `[..]/a-[..]/build-script-build` [RUNNING] `rustc --crate-name a [..]lib.rs --crate-type lib \ @@ -957,7 +960,7 @@ fn build_cmd_with_a_build_cmd() { -C metadata=[..] \ --out-dir [..]target/debug/deps \ -L [..]target/debug/deps` -[COMPILING] foo v0.5.0 (file://[..]) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc --crate-name build_script_build build.rs --crate-type bin \ --emit=dep-info,link \ -C debuginfo=2 -C metadata=[..] --out-dir [..] \ @@ -1054,7 +1057,7 @@ fn output_separate_lines() { .with_status(101) .with_stderr_contains( "\ -[COMPILING] foo v0.5.0 (file://[..]) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc [..] build.rs [..]` [RUNNING] `[..]/foo-[..]/build-script-build` [RUNNING] `rustc --crate-name foo [..] -L foo -l static=foo` @@ -1089,7 +1092,7 @@ fn output_separate_lines_new() { .with_status(101) .with_stderr_contains( "\ -[COMPILING] foo v0.5.0 (file://[..]) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc [..] build.rs [..]` [RUNNING] `[..]/foo-[..]/build-script-build` [RUNNING] `rustc --crate-name foo [..] -L foo -l static=foo` @@ -1143,7 +1146,7 @@ fn code_generation() { p.cargo("run") .with_stderr( "\ -[COMPILING] foo v0.5.0 (file://[..]) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/foo`", ).with_stdout("Hello, World!") @@ -1668,7 +1671,7 @@ fn cfg_test() { p.cargo("test -v") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] [..] build.rs [..] [RUNNING] `[..]/build-script-build` [RUNNING] [..] --cfg foo[..] @@ -1679,7 +1682,6 @@ fn cfg_test() { [RUNNING] `[..]/test-[..][EXE]` [DOCTEST] foo [RUNNING] [..] --cfg foo[..]", - dir = p.url() )).with_stdout_contains("test test_foo ... ok") .with_stdout_contains("test test_bar ... ok") .with_stdout_contains_n("test [..] ... ok", 3) @@ -1774,7 +1776,7 @@ fn cfg_override_test() { p.cargo("test -v") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `[..]` [RUNNING] `[..]` [RUNNING] `[..]` @@ -1783,7 +1785,6 @@ fn cfg_override_test() { [RUNNING] `[..]/test-[..][EXE]` [DOCTEST] foo [RUNNING] [..] --cfg foo[..]", - dir = p.url() )).with_stdout_contains("test test_foo ... ok") .with_stdout_contains("test test_bar ... ok") .with_stdout_contains_n("test [..] ... ok", 3) @@ -1898,7 +1899,7 @@ fn env_test() { p.cargo("test -v") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] [..] build.rs [..] [RUNNING] `[..]/build-script-build` [RUNNING] [..] --crate-name foo[..] @@ -1909,7 +1910,6 @@ fn env_test() { [RUNNING] `[..]/test-[..][EXE]` [DOCTEST] foo [RUNNING] [..] --crate-name foo[..]", - dir = p.url() )).with_stdout_contains_n("running 0 tests", 2) .with_stdout_contains("test test_foo ... ok") .run(); diff --git a/tests/testsuite/cargo_command.rs b/tests/testsuite/cargo_command.rs index 4f8a023510b..1ad31276888 100644 --- a/tests/testsuite/cargo_command.rs +++ b/tests/testsuite/cargo_command.rs @@ -264,10 +264,13 @@ fn cargo_subcommand_args() { cargo_process("foo bar -v --help") .env("PATH", &path) - .with_stdout(format!( - r#"[{:?}, "foo", "bar", "-v", "--help"]"#, - cargo_foo_bin - )).run(); + .with_stdout( + if cfg!(windows) { // weird edge-case w/ CWD & (windows vs unix) + format!(r#"[{:?}, "foo", "bar", "-v", "--help"]"#, cargo_foo_bin) + } else { + r#"["CWD/cargo-foo/target/debug/cargo-foo", "foo", "bar", "-v", "--help"]"#.to_string() + } + ).run(); } #[test] diff --git a/tests/testsuite/cross_compile.rs b/tests/testsuite/cross_compile.rs index 08769df5948..b08e8de3c89 100644 --- a/tests/testsuite/cross_compile.rs +++ b/tests/testsuite/cross_compile.rs @@ -357,18 +357,16 @@ fn linker_and_ar() { .with_status(101) .with_stderr_contains(&format!( "\ -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc --crate-name foo src/foo.rs --crate-type bin \ --emit=dep-info,link -C debuginfo=2 \ -C metadata=[..] \ - --out-dir {dir}/target/{target}/debug/deps \ + --out-dir CWD/target/{target}/debug/deps \ --target {target} \ -C ar=my-ar-tool -C linker=my-linker-tool \ - -L dependency={dir}/target/{target}/debug/deps \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/{target}/debug/deps \ + -L dependency=CWD/target/debug/deps` ", - dir = p.root().display(), - url = p.url(), target = target, )).run(); } @@ -506,11 +504,10 @@ fn cross_tests() { .arg(&target) .with_stderr(&format!( "\ -[COMPILING] foo v0.0.0 ({foo}) +[COMPILING] foo v0.0.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/{triple}/debug/deps/foo-[..][EXE] [RUNNING] target/{triple}/debug/deps/bar-[..][EXE]", - foo = p.url(), triple = target )).with_stdout_contains("test test_foo ... ok") .with_stdout_contains("test test ... ok") @@ -536,12 +533,11 @@ fn no_cross_doctests() { let host_output = format!( "\ -[COMPILING] foo v0.0.1 ({foo}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [DOCTEST] foo ", - foo = p.url() ); println!("a"); @@ -553,12 +549,11 @@ fn no_cross_doctests() { .arg(&target) .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({foo}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/{triple}/debug/deps/foo-[..][EXE] [DOCTEST] foo ", - foo = p.url(), triple = target )).run(); @@ -568,11 +563,10 @@ fn no_cross_doctests() { .arg(&target) .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({foo}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/{triple}/debug/deps/foo-[..][EXE] ", - foo = p.url(), triple = target )).run(); } @@ -650,14 +644,13 @@ fn cross_with_a_build_script() { .arg(&target) .with_stderr(&format!( "\ -[COMPILING] foo v0.0.0 (file://[..]) -[RUNNING] `rustc [..] build.rs [..] --out-dir {dir}/target/debug/build/foo-[..]` -[RUNNING] `{dir}/target/debug/build/foo-[..]/build-script-build` +[COMPILING] foo v0.0.0 (CWD) +[RUNNING] `rustc [..] build.rs [..] --out-dir CWD/target/debug/build/foo-[..]` +[RUNNING] `CWD/target/debug/build/foo-[..]/build-script-build` [RUNNING] `rustc [..] src/main.rs [..] --target {target} [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", target = target, - dir = p.root().display() )).run(); } @@ -739,26 +732,20 @@ fn build_script_needed_for_host_and_target() { p.cargo("build -v --target") .arg(&target) - .with_stderr_contains(&format!("[COMPILING] d1 v0.0.0 ({url}/d1)", url = p.url())) + .with_stderr_contains(&"[COMPILING] d1 v0.0.0 (CWD/d1)") + .with_stderr_contains( + "[RUNNING] `rustc [..] d1/build.rs [..] --out-dir CWD/target/debug/build/d1-[..]`", + ) + .with_stderr_contains("[RUNNING] `CWD/target/debug/build/d1-[..]/build-script-build`") + .with_stderr_contains("[RUNNING] `rustc [..] d1/src/lib.rs [..]`") + .with_stderr_contains("[COMPILING] d2 v0.0.0 (CWD/d2)") .with_stderr_contains(&format!( - "[RUNNING] `rustc [..] d1/build.rs [..] --out-dir {dir}/target/debug/build/d1-[..]`", - dir = p.root().display() - )).with_stderr_contains(&format!( - "[RUNNING] `{dir}/target/debug/build/d1-[..]/build-script-build`", - dir = p.root().display() - )).with_stderr_contains("[RUNNING] `rustc [..] d1/src/lib.rs [..]`") - .with_stderr_contains(&format!("[COMPILING] d2 v0.0.0 ({url}/d2)", url = p.url())) - .with_stderr_contains(&format!( - "\ - [RUNNING] `rustc [..] d2/src/lib.rs [..] \ - -L /path/to/{host}`", + "[RUNNING] `rustc [..] d2/src/lib.rs [..] -L /path/to/{host}`", host = host - )).with_stderr_contains(&format!("[COMPILING] foo v0.0.0 ({url})", url = p.url())) + )).with_stderr_contains("[COMPILING] foo v0.0.0 (CWD)") .with_stderr_contains(&format!( - "\ - [RUNNING] `rustc [..] build.rs [..] --out-dir {dir}/target/debug/build/foo-[..] \ + "[RUNNING] `rustc [..] build.rs [..] --out-dir CWD/target/debug/build/foo-[..] \ -L /path/to/{host}`", - dir = p.root().display(), host = host )).with_stderr_contains(&format!( "\ @@ -953,11 +940,10 @@ fn build_script_with_platform_specific_dependencies() { [RUNNING] `rustc [..] d1/src/lib.rs [..]` [COMPILING] foo v0.0.1 ([..]) [RUNNING] `rustc [..] build.rs [..]` -[RUNNING] `{dir}/target/debug/build/foo-[..]/build-script-build` +[RUNNING] `CWD/target/debug/build/foo-[..]/build-script-build` [RUNNING] `rustc [..] src/lib.rs [..] --target {target} [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.root().display(), target = target )).run(); } @@ -1167,12 +1153,11 @@ fn cross_test_dylib() { .arg(&target) .with_stderr(&format!( "\ -[COMPILING] bar v0.0.1 ({dir}/bar) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] bar v0.0.1 (CWD/bar) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/{arch}/debug/deps/foo-[..][EXE] [RUNNING] target/{arch}/debug/deps/test-[..][EXE]", - dir = p.url(), arch = cross_compile::alternate() )).with_stdout_contains_n("test foo ... ok", 2) .run(); diff --git a/tests/testsuite/cross_publish.rs b/tests/testsuite/cross_publish.rs index 6a37489895b..959a1177bed 100644 --- a/tests/testsuite/cross_publish.rs +++ b/tests/testsuite/cross_publish.rs @@ -42,12 +42,11 @@ fn simple_cross_package() { p.cargo("package --target") .arg(&target) .with_stderr(&format!( - " Packaging foo v0.0.0 ({dir}) - Verifying foo v0.0.0 ({dir}) - Compiling foo v0.0.0 ({dir}/target/package/foo-0.0.0) + " Packaging foo v0.0.0 (CWD) + Verifying foo v0.0.0 (CWD) + Compiling foo v0.0.0 (CWD/target/package/foo-0.0.0) Finished dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); // Check that the tarball contains the files @@ -106,13 +105,12 @@ fn publish_with_target() { .arg(&target) .with_stderr(&format!( " Updating registry `{registry}` - Packaging foo v0.0.0 ({dir}) - Verifying foo v0.0.0 ({dir}) - Compiling foo v0.0.0 ({dir}/target/package/foo-0.0.0) + Packaging foo v0.0.0 (CWD) + Verifying foo v0.0.0 (CWD) + Compiling foo v0.0.0 (CWD/target/package/foo-0.0.0) Finished dev [unoptimized + debuginfo] target(s) in [..] - Uploading foo v0.0.0 ({dir}) + Uploading foo v0.0.0 (CWD) ", - dir = p.url(), registry = publish::registry() )).run(); } diff --git a/tests/testsuite/directory.rs b/tests/testsuite/directory.rs index 0188a177034..3d0bcc3bbd3 100644 --- a/tests/testsuite/directory.rs +++ b/tests/testsuite/directory.rs @@ -102,7 +102,7 @@ fn simple() { .with_stderr( "\ [COMPILING] bar v0.1.0 -[COMPILING] foo v0.1.0 ([..]foo) +[COMPILING] foo v0.1.0 (CWD) [FINISHED] [..] ", ).run(); @@ -298,7 +298,7 @@ fn multiple() { .with_stderr( "\ [COMPILING] bar v0.1.0 -[COMPILING] foo v0.1.0 ([..]foo) +[COMPILING] foo v0.1.0 (CWD) [FINISHED] [..] ", ).run(); @@ -333,7 +333,7 @@ fn crates_io_then_directory() { [UPDATING] registry `[..]` [DOWNLOADING] bar v0.1.0 ([..]) [COMPILING] bar v0.1.0 -[COMPILING] foo v0.1.0 ([..]foo) +[COMPILING] foo v0.1.0 (CWD) [FINISHED] [..] ", ).run(); @@ -350,7 +350,7 @@ fn crates_io_then_directory() { .with_stderr( "\ [COMPILING] bar v0.1.0 -[COMPILING] foo v0.1.0 ([..]foo) +[COMPILING] foo v0.1.0 (CWD) [FINISHED] [..] ", ).run(); diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index bdfef237660..f8cc182c389 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -6,7 +6,7 @@ use support; use glob::glob; use support::paths::CargoPathExt; use support::registry::Package; -use support::{basic_lib_manifest, basic_manifest, git, path2url, project}; +use support::{basic_lib_manifest, basic_manifest, git, project}; use support::{is_nightly, rustc_host}; #[test] @@ -28,11 +28,10 @@ fn simple() { p.cargo("doc") .with_stderr(&format!( "\ -[..] foo v0.0.1 ({dir}) -[..] foo v0.0.1 ({dir}) +[..] foo v0.0.1 (CWD) +[..] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); assert!(p.root().join("target/doc").is_dir()); assert!(p.root().join("target/doc/foo/index.html").is_file()); @@ -66,10 +65,9 @@ fn doc_twice() { p.cargo("doc") .with_stderr(&format!( "\ -[DOCUMENTING] foo v0.0.1 ({dir}) +[DOCUMENTING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); p.cargo("doc").with_stdout("").run(); @@ -97,12 +95,11 @@ fn doc_deps() { p.cargo("doc") .with_stderr(&format!( "\ -[..] bar v0.0.1 ({dir}/bar) -[..] bar v0.0.1 ({dir}/bar) -[DOCUMENTING] foo v0.0.1 ({dir}) +[..] bar v0.0.1 (CWD/bar) +[..] bar v0.0.1 (CWD/bar) +[DOCUMENTING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); assert!(p.root().join("target/doc").is_dir()); @@ -159,11 +156,10 @@ fn doc_no_deps() { p.cargo("doc --no-deps") .with_stderr(&format!( "\ -[CHECKING] bar v0.0.1 ({dir}/bar) -[DOCUMENTING] foo v0.0.1 ({dir}) +[CHECKING] bar v0.0.1 (CWD/bar) +[DOCUMENTING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); assert!(p.root().join("target/doc").is_dir()); @@ -268,11 +264,9 @@ fn doc_multiple_targets_same_name() { ).file("bar/src/lib.rs", "") .build(); - let root = path2url(p.root()); - p.cargo("doc --all") - .with_stderr_contains(&format!("[DOCUMENTING] foo v0.1.0 ({}/foo)", root)) - .with_stderr_contains(&format!("[DOCUMENTING] bar v0.1.0 ({}/bar)", root)) + .with_stderr_contains("[DOCUMENTING] foo v0.1.0 (CWD/foo)") + .with_stderr_contains("[DOCUMENTING] bar v0.1.0 (CWD/bar)") .with_stderr_contains("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") .run(); assert!(p.root().join("target/doc").is_dir()); @@ -377,10 +371,9 @@ fn doc_lib_bin_same_name_documents_lib() { p.cargo("doc") .with_stderr(&format!( "\ -[DOCUMENTING] foo v0.0.1 ({dir}) +[DOCUMENTING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); assert!(p.root().join("target/doc").is_dir()); let doc_file = p.root().join("target/doc/foo/index.html"); @@ -417,10 +410,9 @@ fn doc_lib_bin_same_name_documents_lib_when_requested() { p.cargo("doc --lib") .with_stderr(&format!( "\ -[DOCUMENTING] foo v0.0.1 ({dir}) +[DOCUMENTING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); assert!(p.root().join("target/doc").is_dir()); let doc_file = p.root().join("target/doc/foo/index.html"); @@ -457,11 +449,10 @@ fn doc_lib_bin_same_name_documents_named_bin_when_requested() { p.cargo("doc --bin foo") .with_stderr(&format!( "\ -[CHECKING] foo v0.0.1 ({dir}) -[DOCUMENTING] foo v0.0.1 ({dir}) +[CHECKING] foo v0.0.1 (CWD) +[DOCUMENTING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); assert!(p.root().join("target/doc").is_dir()); let doc_file = p.root().join("target/doc/foo/index.html"); @@ -498,11 +489,10 @@ fn doc_lib_bin_same_name_documents_bins_when_requested() { p.cargo("doc --bins") .with_stderr(&format!( "\ -[CHECKING] foo v0.0.1 ({dir}) -[DOCUMENTING] foo v0.0.1 ({dir}) +[CHECKING] foo v0.0.1 (CWD) +[DOCUMENTING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); assert!(p.root().join("target/doc").is_dir()); let doc_file = p.root().join("target/doc/foo/index.html"); @@ -550,9 +540,9 @@ fn doc_dash_p() { p.cargo("doc -p a") .with_stderr( "\ -[..] b v0.0.1 (file://[..]) -[..] b v0.0.1 (file://[..]) -[DOCUMENTING] a v0.0.1 (file://[..]) +[..] b v0.0.1 (CWD/b) +[..] b v0.0.1 (CWD/b) +[DOCUMENTING] a v0.0.1 (CWD/a) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -1038,7 +1028,7 @@ fn doc_workspace_open_different_library_and_package_names() { p.cargo("doc --open") .env("BROWSER", "echo") .with_stderr_contains("[..] Documenting foo v0.1.0 ([..])") - .with_stderr_contains("[..] Opening [..]/foo/target/doc/foolib/index.html") + .with_stderr_contains("[..] CWD/target/doc/foolib/index.html") .run(); } @@ -1068,7 +1058,7 @@ fn doc_workspace_open_binary() { p.cargo("doc --open") .env("BROWSER", "echo") .with_stderr_contains("[..] Documenting foo v0.1.0 ([..])") - .with_stderr_contains("[..] Opening [..]/foo/target/doc/foobin/index.html") + .with_stderr_contains("[..] Opening CWD/target/doc/foobin/index.html") .run(); } @@ -1101,7 +1091,7 @@ fn doc_workspace_open_binary_and_library() { p.cargo("doc --open") .env("BROWSER", "echo") .with_stderr_contains("[..] Documenting foo v0.1.0 ([..])") - .with_stderr_contains("[..] Opening [..]/foo/target/doc/foolib/index.html") + .with_stderr_contains("[..] Opening CWD/target/doc/foolib/index.html") .run(); } diff --git a/tests/testsuite/features.rs b/tests/testsuite/features.rs index a0657258820..d3afcd0dc32 100644 --- a/tests/testsuite/features.rs +++ b/tests/testsuite/features.rs @@ -417,21 +417,19 @@ fn no_feature_doesnt_build() { p.cargo("build") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); p.process(&p.bin("foo")).with_stdout("").run(); p.cargo("build --features bar") .with_stderr(format!( "\ -[COMPILING] bar v0.0.1 ({dir}/bar) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] bar v0.0.1 (CWD/bar) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); p.process(&p.bin("foo")).with_stdout("bar\n").run(); } @@ -471,21 +469,19 @@ fn default_feature_pulled_in() { p.cargo("build") .with_stderr(format!( "\ -[COMPILING] bar v0.0.1 ({dir}/bar) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] bar v0.0.1 (CWD/bar) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); p.process(&p.bin("foo")).with_stdout("bar\n").run(); p.cargo("build --no-default-features") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); p.process(&p.bin("foo")).with_stdout("").run(); } @@ -581,12 +577,11 @@ fn groups_on_groups_on_groups() { p.cargo("build") .with_stderr(format!( "\ -[COMPILING] ba[..] v0.0.1 ({dir}/ba[..]) -[COMPILING] ba[..] v0.0.1 ({dir}/ba[..]) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] ba[..] v0.0.1 (CWD/ba[..]) +[COMPILING] ba[..] v0.0.1 (CWD/ba[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); } @@ -628,12 +623,11 @@ fn many_cli_features() { .arg("bar baz") .with_stderr(format!( "\ -[COMPILING] ba[..] v0.0.1 ({dir}/ba[..]) -[COMPILING] ba[..] v0.0.1 ({dir}/ba[..]) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] ba[..] v0.0.1 (CWD/ba[..]) +[COMPILING] ba[..] v0.0.1 (CWD/ba[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); } @@ -706,12 +700,11 @@ fn union_features() { p.cargo("build") .with_stderr(format!( "\ -[COMPILING] d2 v0.0.1 ({dir}/d2) -[COMPILING] d1 v0.0.1 ({dir}/d1) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] d2 v0.0.1 (CWD/d2) +[COMPILING] d1 v0.0.1 (CWD/d1) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); } @@ -750,11 +743,10 @@ fn many_features_no_rebuilds() { p.cargo("build") .with_stderr(format!( "\ -[COMPILING] a v0.1.0 ({dir}/a) -[COMPILING] b v0.1.0 ({dir}) +[COMPILING] a v0.1.0 (CWD/a) +[COMPILING] b v0.1.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); p.root().move_into_the_past(); @@ -1207,12 +1199,11 @@ fn many_cli_features_comma_delimited() { p.cargo("build --features bar,baz") .with_stderr(format!( "\ -[COMPILING] ba[..] v0.0.1 ({dir}/ba[..]) -[COMPILING] ba[..] v0.0.1 ({dir}/ba[..]) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] ba[..] v0.0.1 (CWD/ba[..]) +[COMPILING] ba[..] v0.0.1 (CWD/ba[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); } @@ -1270,14 +1261,13 @@ fn many_cli_features_comma_and_space_delimited() { .arg("bar,baz bam bap") .with_stderr(format!( "\ -[COMPILING] ba[..] v0.0.1 ({dir}/ba[..]) -[COMPILING] ba[..] v0.0.1 ({dir}/ba[..]) -[COMPILING] ba[..] v0.0.1 ({dir}/ba[..]) -[COMPILING] ba[..] v0.0.1 ({dir}/ba[..]) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] ba[..] v0.0.1 (CWD/ba[..]) +[COMPILING] ba[..] v0.0.1 (CWD/ba[..]) +[COMPILING] ba[..] v0.0.1 (CWD/ba[..]) +[COMPILING] ba[..] v0.0.1 (CWD/ba[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); } diff --git a/tests/testsuite/freshness.rs b/tests/testsuite/freshness.rs index e1b103daafe..14c2afb32eb 100644 --- a/tests/testsuite/freshness.rs +++ b/tests/testsuite/freshness.rs @@ -4,7 +4,7 @@ use std::io::prelude::*; use support::paths::CargoPathExt; use support::registry::Package; use support::sleep_ms; -use support::{basic_manifest, path2url, project}; +use support::{basic_manifest, project}; #[test] fn modifying_and_moving() { @@ -16,10 +16,9 @@ fn modifying_and_moving() { p.cargo("build") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); p.cargo("build").with_stdout("").run(); @@ -33,10 +32,9 @@ fn modifying_and_moving() { p.cargo("build") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); fs::rename(&p.root().join("src/a.rs"), &p.root().join("src/b.rs")).unwrap(); @@ -56,10 +54,9 @@ fn modify_only_some_files() { p.cargo("build") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); p.cargo("test").run(); sleep_ms(1000); @@ -83,10 +80,9 @@ fn modify_only_some_files() { p.cargo("build") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = path2url(p.root()) )).run(); assert!(p.bin("foo").is_file()); } @@ -648,7 +644,7 @@ fn same_build_dir_cached_packages() { [COMPILING] d v0.0.1 ({dir}/d) [COMPILING] c v0.0.1 ({dir}/c) [COMPILING] b v0.0.1 ({dir}/b) -[COMPILING] a1 v0.0.1 ({dir}/a1) +[COMPILING] a1 v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", dir = p.url() @@ -657,10 +653,9 @@ fn same_build_dir_cached_packages() { .cwd(p.root().join("a2")) .with_stderr(&format!( "\ -[COMPILING] a2 v0.0.1 ({dir}/a2) +[COMPILING] a2 v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); } @@ -753,11 +748,10 @@ fn rebuild_if_environment_changes() { .with_stdout("old desc") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/foo[EXE]` ", - dir = p.url() )).run(); File::create(&p.root().join("Cargo.toml")) @@ -776,11 +770,10 @@ fn rebuild_if_environment_changes() { .with_stdout("new desc") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/foo[EXE]` ", - dir = p.url() )).run(); } diff --git a/tests/testsuite/git.rs b/tests/testsuite/git.rs index 3e94c8e0349..a0e6c9302e8 100644 --- a/tests/testsuite/git.rs +++ b/tests/testsuite/git.rs @@ -49,7 +49,6 @@ fn cargo_compile_simple_git_dep() { &main_file(r#""{}", dep1::hello()"#, &["dep1"]), ).build(); - let root = project.root(); let git_root = git_project.root(); project @@ -57,11 +56,10 @@ fn cargo_compile_simple_git_dep() { .with_stderr(&format!( "[UPDATING] git repository `{}`\n\ [COMPILING] dep1 v0.5.0 ({}#[..])\n\ - [COMPILING] foo v0.5.0 ({})\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", path2url(&git_root), - path2url(git_root), - path2url(root) + path2url(&git_root), )).run(); assert!(project.bin("foo").is_file()); @@ -187,7 +185,6 @@ fn cargo_compile_offline_with_cached_git_dep() { &main_file(r#""hello from {}", dep1::COOL_STR"#, &["dep1"]), ).build(); - let root = p.root(); let git_root = git_project.root(); p.cargo("build -Zoffline") @@ -195,10 +192,9 @@ fn cargo_compile_offline_with_cached_git_dep() { .with_stderr(format!( "\ [COMPILING] dep1 v0.5.0 ({}#[..]) -[COMPILING] foo v0.5.0 ({}) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", path2url(git_root), - path2url(root) )).run(); assert!(p.bin("foo").is_file()); @@ -277,7 +273,6 @@ fn cargo_compile_git_dep_branch() { &main_file(r#""{}", dep1::hello()"#, &["dep1"]), ).build(); - let root = project.root(); let git_root = git_project.root(); project @@ -285,11 +280,10 @@ fn cargo_compile_git_dep_branch() { .with_stderr(&format!( "[UPDATING] git repository `{}`\n\ [COMPILING] dep1 v0.5.0 ({}?branch=branchy#[..])\n\ - [COMPILING] foo v0.5.0 ({})\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", path2url(&git_root), - path2url(git_root), - path2url(root) + path2url(&git_root), )).run(); assert!(project.bin("foo").is_file()); @@ -350,7 +344,6 @@ fn cargo_compile_git_dep_tag() { &main_file(r#""{}", dep1::hello()"#, &["dep1"]), ).build(); - let root = project.root(); let git_root = git_project.root(); project @@ -358,11 +351,10 @@ fn cargo_compile_git_dep_tag() { .with_stderr(&format!( "[UPDATING] git repository `{}`\n\ [COMPILING] dep1 v0.5.0 ({}?tag=v0.1.0#[..])\n\ - [COMPILING] foo v0.5.0 ({})\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", path2url(&git_root), - path2url(git_root), - path2url(root) + path2url(&git_root), )).run(); assert!(project.bin("foo").is_file()); @@ -729,12 +721,11 @@ fn recompilation() { .with_stderr(&format!( "[UPDATING] git repository `{}`\n\ [COMPILING] bar v0.5.0 ({}#[..])\n\ - [COMPILING] foo v0.5.0 ({})\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", git_project.url(), git_project.url(), - p.url() )).run(); // Don't recompile the second time @@ -778,22 +769,20 @@ fn recompilation() { p.cargo("build") .with_stderr(&format!( "[COMPILING] bar v0.5.0 ({}#[..])\n\ - [COMPILING] foo v0.5.0 ({})\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", git_project.url(), - p.url() )).run(); // Make sure clean only cleans one dep p.cargo("clean -p foo").with_stdout("").run(); p.cargo("build") - .with_stderr(&format!( - "[COMPILING] foo v0.5.0 ({})\n\ + .with_stderr( + "[COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ - in [..]\n", - p.url() - )).run(); + in [..]" + ).run(); } #[test] @@ -869,10 +858,9 @@ fn update_with_shared_deps() { [COMPILING] bar v0.5.0 ({git}#[..]) [COMPILING] [..] v0.5.0 ([..]) [COMPILING] [..] v0.5.0 ([..]) -[COMPILING] foo v0.5.0 ({dir}) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", git = git_project.url(), - dir = p.url() )).run(); // Modify a file manually, and commit it @@ -929,12 +917,11 @@ Caused by: .with_stderr(&format!( "\ [COMPILING] bar v0.5.0 ({git}#[..]) -[COMPILING] [..] v0.5.0 ({dir}[..]dep[..]) -[COMPILING] [..] v0.5.0 ({dir}[..]dep[..]) -[COMPILING] foo v0.5.0 ({dir}) +[COMPILING] [..] v0.5.0 (CWD[..]dep[..]) +[COMPILING] [..] v0.5.0 (CWD[..]dep[..]) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", git = git_project.url(), - dir = p.url() )).run(); // We should be able to update transitive deps @@ -1103,15 +1090,14 @@ fn two_deps_only_update_one() { .build(); p.cargo("build") - .with_stderr(&format!( + .with_stderr( "[UPDATING] git repository `[..]`\n\ [UPDATING] git repository `[..]`\n\ [COMPILING] [..] v0.5.0 ([..])\n\ [COMPILING] [..] v0.5.0 ([..])\n\ - [COMPILING] foo v0.5.0 ({})\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", - p.url() - )).run(); + ).run(); File::create(&git1.root().join("src/lib.rs")) .unwrap() @@ -1209,11 +1195,10 @@ fn stale_cached_version() { "\ [UPDATING] git repository `{bar}` [COMPILING] bar v0.0.0 ({bar}#[..]) -[COMPILING] foo v0.0.0 ({foo}) +[COMPILING] foo v0.0.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", bar = bar.url(), - foo = foo.url() )).run(); foo.process(&foo.bin("foo")).run(); } @@ -1373,10 +1358,9 @@ fn dev_deps_with_testing() { .with_stderr(&format!( "\ [UPDATING] git repository `{bar}` -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = p.url(), bar = p2.url() )).run(); @@ -1417,10 +1401,9 @@ fn git_build_cmd_freshness() { foo.cargo("build") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.0 ({url}) +[COMPILING] foo v0.0.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = foo.url() )).run(); // Smoke test to make sure it doesn't compile again @@ -1475,10 +1458,9 @@ fn git_name_not_always_needed() { .with_stderr(&format!( "\ [UPDATING] git repository `{bar}` -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = p.url(), bar = p2.url() )).run(); } @@ -1698,11 +1680,10 @@ fn warnings_in_git_dep() { .with_stderr(&format!( "[UPDATING] git repository `{}`\n\ [COMPILING] bar v0.5.0 ({}#[..])\n\ - [COMPILING] foo v0.5.0 ({})\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", bar.url(), bar.url(), - p.url() )).run(); } @@ -2510,7 +2491,7 @@ fn invalid_git_dependency_manifest() { Caused by:\n \ duplicate key: `categories` for key `project`", path2url(&git_root), - path2url(git_root), + path2url(&git_root), )).run(); } diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs index e045dc34253..0c5cb3f076f 100644 --- a/tests/testsuite/install.rs +++ b/tests/testsuite/install.rs @@ -24,25 +24,22 @@ fn simple() { pkg("foo", "0.0.1"); cargo_process("install foo") - .with_stderr(&format!( + .with_stderr( "\ [UPDATING] registry `[..]` [DOWNLOADING] foo v0.0.1 (registry [..]) [INSTALLING] foo v0.0.1 [COMPILING] foo v0.0.1 [FINISHED] release [optimized] target(s) in [..] -[INSTALLING] {home}[..]bin[..]foo[..] +[INSTALLING] CWD/home/.cargo/bin/foo[EXE] warning: be sure to add `[..]` to your PATH to be able to run the installed binaries ", - home = cargo_home().display() - )).run(); + ).run(); assert_has_installed_exe(cargo_home(), "foo"); cargo_process("uninstall foo") - .with_stderr(&format!( - "[REMOVING] {home}[..]bin[..]foo[..]", - home = cargo_home().display() - )).run(); + .with_stderr("[REMOVING] CWD/home/.cargo/bin/foo[EXE]") + .run(); assert_has_not_installed_exe(cargo_home(), "foo"); } @@ -53,38 +50,36 @@ fn multiple_pkgs() { cargo_process("install foo bar baz") .with_status(101) - .with_stderr(&format!( + .with_stderr( "\ [UPDATING] registry `[..]` -[DOWNLOADING] foo v0.0.1 (registry `file://[..]`) +[DOWNLOADING] foo v0.0.1 (registry `CWD/registry`) [INSTALLING] foo v0.0.1 [COMPILING] foo v0.0.1 [FINISHED] release [optimized] target(s) in [..] -[INSTALLING] {home}[..]bin[..]foo[..] -[DOWNLOADING] bar v0.0.2 (registry `file://[..]`) +[INSTALLING] CWD/home/.cargo/bin/foo[EXE] +[DOWNLOADING] bar v0.0.2 (registry `CWD/registry`) [INSTALLING] bar v0.0.2 [COMPILING] bar v0.0.2 [FINISHED] release [optimized] target(s) in [..] -[INSTALLING] {home}[..]bin[..]bar[..] +[INSTALLING] CWD/home/.cargo/bin/bar[EXE] error: could not find `baz` in registry `[..]` [SUMMARY] Successfully installed foo, bar! Failed to install baz (see error(s) above). warning: be sure to add `[..]` to your PATH to be able to run the installed binaries error: some crates failed to install ", - home = cargo_home().display() - )).run(); + ).run(); assert_has_installed_exe(cargo_home(), "foo"); assert_has_installed_exe(cargo_home(), "bar"); cargo_process("uninstall foo bar") - .with_stderr(&format!( + .with_stderr( "\ -[REMOVING] {home}[..]bin[..]foo[..] -[REMOVING] {home}[..]bin[..]bar[..] +[REMOVING] CWD/home/.cargo/bin/foo[EXE] +[REMOVING] CWD/home/.cargo/bin/bar[EXE] [SUMMARY] Successfully uninstalled foo, bar! ", - home = cargo_home().display() - )).run(); + ).run(); assert_has_not_installed_exe(cargo_home(), "foo"); assert_has_not_installed_exe(cargo_home(), "bar"); @@ -99,18 +94,17 @@ fn pick_max_version() { pkg("foo", "0.3.0-pre.2"); cargo_process("install foo") - .with_stderr(&format!( + .with_stderr( "\ [UPDATING] registry `[..]` [DOWNLOADING] foo v0.2.1 (registry [..]) [INSTALLING] foo v0.2.1 [COMPILING] foo v0.2.1 [FINISHED] release [optimized] target(s) in [..] -[INSTALLING] {home}[..]bin[..]foo[..] +[INSTALLING] CWD/home/.cargo/bin/foo[EXE] warning: be sure to add `[..]` to your PATH to be able to run the installed binaries ", - home = cargo_home().display() - )).run(); + ).run(); assert_has_installed_exe(cargo_home(), "foo"); } @@ -436,16 +430,15 @@ fn install_force() { cargo_process("install --force --path") .arg(p.root()) - .with_stderr(&format!( + .with_stderr( "\ [INSTALLING] foo v0.2.0 ([..]) [COMPILING] foo v0.2.0 ([..]) [FINISHED] release [optimized] target(s) in [..] -[REPLACING] {home}[..]bin[..]foo[..] +[REPLACING] CWD/home/.cargo/bin/foo[EXE] warning: be sure to add `[..]` to your PATH to be able to run the installed binaries ", - home = cargo_home().display() - )).run(); + ).run(); cargo_process("install --list") .with_stdout( @@ -474,17 +467,16 @@ fn install_force_partial_overlap() { cargo_process("install --force --path") .arg(p.root()) - .with_stderr(&format!( + .with_stderr( "\ [INSTALLING] foo v0.2.0 ([..]) [COMPILING] foo v0.2.0 ([..]) [FINISHED] release [optimized] target(s) in [..] -[INSTALLING] {home}[..]bin[..]foo-bin3[..] -[REPLACING] {home}[..]bin[..]foo-bin2[..] +[INSTALLING] CWD/home/.cargo/bin/foo-bin3[EXE] +[REPLACING] CWD/home/.cargo/bin/foo-bin2[EXE] warning: be sure to add `[..]` to your PATH to be able to run the installed binaries ", - home = cargo_home().display() - )).run(); + ).run(); cargo_process("install --list") .with_stdout( @@ -516,16 +508,15 @@ fn install_force_bin() { cargo_process("install --force --bin foo-bin2 --path") .arg(p.root()) - .with_stderr(&format!( + .with_stderr( "\ [INSTALLING] foo v0.2.0 ([..]) [COMPILING] foo v0.2.0 ([..]) [FINISHED] release [optimized] target(s) in [..] -[REPLACING] {home}[..]bin[..]foo-bin2[..] +[REPLACING] CWD/home/.cargo/bin/foo-bin2[EXE] warning: be sure to add `[..]` to your PATH to be able to run the installed binaries ", - home = cargo_home().display() - )).run(); + ).run(); cargo_process("install --list") .with_stdout( @@ -568,17 +559,16 @@ fn git_repo() { // use `--locked` to test that we don't even try to write a lockfile cargo_process("install --locked --git") .arg(p.url().to_string()) - .with_stderr(&format!( + .with_stderr( "\ [UPDATING] git repository `[..]` [INSTALLING] foo v0.1.0 ([..]) [COMPILING] foo v0.1.0 ([..]) [FINISHED] release [optimized] target(s) in [..] -[INSTALLING] {home}[..]bin[..]foo[..] +[INSTALLING] CWD/home/.cargo/bin/foo[EXE] warning: be sure to add `[..]` to your PATH to be able to run the installed binaries ", - home = cargo_home().display() - )).run(); + ).run(); assert_has_installed_exe(cargo_home(), "foo"); assert_has_installed_exe(cargo_home(), "foo"); } @@ -754,13 +744,12 @@ fn uninstall_cwd() { p.cargo("install --path .") .with_stderr(&format!( "\ -[INSTALLING] foo v0.0.1 ({url}) -[COMPILING] foo v0.0.1 ({url}) +[INSTALLING] foo v0.0.1 (CWD) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [INSTALLING] {home}/bin/foo[EXE] warning: be sure to add `{home}/bin` to your PATH to be able to run the installed binaries", home = cargo_home().display(), - url = p.url(), )).run(); assert_has_installed_exe(cargo_home(), "foo"); @@ -782,8 +771,7 @@ fn uninstall_cwd_not_installed() { .with_stdout("") .with_stderr(format!( "\ - error: package `foo v0.0.1 ({url})` is not installed", - url = p.url(), + error: package `foo v0.0.1 (CWD)` is not installed", )).run(); } @@ -799,11 +787,10 @@ fn uninstall_cwd_no_project() { .with_stdout("") .with_stderr(format!( "\ -[ERROR] failed to read `{root}/Cargo.toml` +[ERROR] failed to read `CWD/Cargo.toml` Caused by: {err_msg} (os error 2)", - root = paths::root().display(), err_msg = err_msg, )).run(); } @@ -1082,15 +1069,14 @@ fn uninstall_multiple_and_some_pkg_does_not_exist() { cargo_process("uninstall foo bar") .with_status(101) - .with_stderr(&format!( + .with_stderr( "\ -[REMOVING] {home}[..]bin[..]foo[..] +[REMOVING] CWD/home/.cargo/bin/foo[EXE] error: package id specification `bar` matched no packages [SUMMARY] Successfully uninstalled foo! Failed to uninstall bar (see error(s) above). error: some packages failed to uninstall ", - home = cargo_home().display() - )).run(); + ).run(); assert_has_not_installed_exe(cargo_home(), "foo"); assert_has_not_installed_exe(cargo_home(), "bar"); diff --git a/tests/testsuite/local_registry.rs b/tests/testsuite/local_registry.rs index 30ea642394f..13880aa0969 100644 --- a/tests/testsuite/local_registry.rs +++ b/tests/testsuite/local_registry.rs @@ -50,10 +50,9 @@ fn simple() { "\ [UNPACKING] bar v0.0.1 ([..]) [COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] [..] ", - dir = p.url() )).run(); p.cargo("build").with_stderr("[FINISHED] [..]").run(); p.cargo("test").run(); @@ -90,10 +89,9 @@ fn multiple_versions() { "\ [UNPACKING] bar v0.1.0 ([..]) [COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] [..] ", - dir = p.url() )).run(); Package::new("bar", "0.2.0") @@ -150,10 +148,9 @@ fn multiple_names() { [UNPACKING] [..] [COMPILING] [..] [COMPILING] [..] -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] [..] ", - dir = p.url() )).run(); } @@ -202,10 +199,9 @@ fn interdependent() { [UNPACKING] [..] [COMPILING] bar v0.0.1 [COMPILING] baz v0.1.0 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] [..] ", - dir = p.url() )).run(); } @@ -267,10 +263,9 @@ fn path_dep_rewritten() { [UNPACKING] [..] [COMPILING] bar v0.0.1 [COMPILING] baz v0.1.0 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] [..] ", - dir = p.url() )).run(); } @@ -418,10 +413,9 @@ fn crates_io_registry_url_is_optional() { "\ [UNPACKING] bar v0.0.1 ([..]) [COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] [..] ", - dir = p.url() )).run(); p.cargo("build").with_stderr("[FINISHED] [..]").run(); p.cargo("test").run(); diff --git a/tests/testsuite/new.rs b/tests/testsuite/new.rs index 76056a90435..44c0b142a14 100644 --- a/tests/testsuite/new.rs +++ b/tests/testsuite/new.rs @@ -104,11 +104,10 @@ fn existing() { fs::create_dir(&dst).unwrap(); cargo_process("new foo") .with_status(101) - .with_stderr(format!( - "[ERROR] destination `{}` already exists\n\n\ + .with_stderr( + "[ERROR] destination `CWD/foo` already exists\n\n\ Use `cargo init` to initialize the directory", - dst.display() - )).run(); + ).run(); } #[test] diff --git a/tests/testsuite/overrides.rs b/tests/testsuite/overrides.rs index 4d0940c052e..90c43f595e0 100644 --- a/tests/testsuite/overrides.rs +++ b/tests/testsuite/overrides.rs @@ -41,7 +41,7 @@ fn override_simple() { [UPDATING] registry `file://[..]` [UPDATING] git repository `[..]` [COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -188,7 +188,7 @@ fn transitive() { [DOWNLOADING] baz v0.2.0 (registry [..]) [COMPILING] bar v0.1.0 (file://[..]) [COMPILING] baz v0.2.0 -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -234,7 +234,7 @@ fn persists_across_rebuilds() { [UPDATING] registry `file://[..]` [UPDATING] git repository `file://[..]` [COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -277,7 +277,7 @@ fn replace_registry_with_path() { "\ [UPDATING] registry `file://[..]` [COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -343,7 +343,7 @@ fn use_a_spec_to_select() { [COMPILING] [..] [COMPILING] [..] [COMPILING] [..] -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -398,7 +398,7 @@ fn override_adds_some_deps() { [DOWNLOADING] baz v0.1.1 (registry [..]) [COMPILING] baz v0.1.1 [COMPILING] bar v0.1.0 ([..]) -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs index 48c74893b81..0b1f96c1c13 100644 --- a/tests/testsuite/package.rs +++ b/tests/testsuite/package.rs @@ -31,12 +31,11 @@ fn simple() { "\ [WARNING] manifest has no documentation[..] See [..] -[PACKAGING] foo v0.0.1 ({dir}) -[VERIFYING] foo v0.0.1 ({dir}) -[COMPILING] foo v0.0.1 ({dir}[..]) +[PACKAGING] foo v0.0.1 (CWD) +[VERIFYING] foo v0.0.1 (CWD) +[COMPILING] foo v0.0.1 (CWD[..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); assert!(p.root().join("target/package/foo-0.0.1.crate").is_file()); p.cargo("package -l") @@ -76,12 +75,11 @@ fn metadata_warning() { warning: manifest has no description, license, license-file, documentation, \ homepage or repository. See http://doc.crates.io/manifest.html#package-metadata for more info. -[PACKAGING] foo v0.0.1 ({dir}) -[VERIFYING] foo v0.0.1 ({dir}) -[COMPILING] foo v0.0.1 ({dir}[..]) +[PACKAGING] foo v0.0.1 (CWD) +[VERIFYING] foo v0.0.1 (CWD) +[COMPILING] foo v0.0.1 (CWD[..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); let p = project() @@ -101,12 +99,11 @@ See http://doc.crates.io/manifest.html#package-metadata for more info. "\ warning: manifest has no description, documentation, homepage or repository. See http://doc.crates.io/manifest.html#package-metadata for more info. -[PACKAGING] foo v0.0.1 ({dir}) -[VERIFYING] foo v0.0.1 ({dir}) -[COMPILING] foo v0.0.1 ({dir}[..]) +[PACKAGING] foo v0.0.1 (CWD) +[VERIFYING] foo v0.0.1 (CWD) +[COMPILING] foo v0.0.1 (CWD[..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); let p = project() @@ -126,12 +123,11 @@ See http://doc.crates.io/manifest.html#package-metadata for more info. p.cargo("package") .with_stderr(&format!( "\ -[PACKAGING] foo v0.0.1 ({dir}) -[VERIFYING] foo v0.0.1 ({dir}) -[COMPILING] foo v0.0.1 ({dir}[..]) +[PACKAGING] foo v0.0.1 (CWD) +[VERIFYING] foo v0.0.1 (CWD) +[COMPILING] foo v0.0.1 (CWD[..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); } @@ -210,12 +206,11 @@ fn package_verification() { "\ [WARNING] manifest has no description[..] See http://doc.crates.io/manifest.html#package-metadata for more info. -[PACKAGING] foo v0.0.1 ({dir}) -[VERIFYING] foo v0.0.1 ({dir}) -[COMPILING] foo v0.0.1 ({dir}[..]) +[PACKAGING] foo v0.0.1 (CWD) +[VERIFYING] foo v0.0.1 (CWD) +[COMPILING] foo v0.0.1 (CWD[..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); } @@ -550,12 +545,11 @@ fn ignore_nested() { "\ [WARNING] manifest has no documentation[..] See http://doc.crates.io/manifest.html#package-metadata for more info. -[PACKAGING] foo v0.0.1 ({dir}) -[VERIFYING] foo v0.0.1 ({dir}) -[COMPILING] foo v0.0.1 ({dir}[..]) +[PACKAGING] foo v0.0.1 (CWD) +[VERIFYING] foo v0.0.1 (CWD) +[COMPILING] foo v0.0.1 (CWD[..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); assert!(p.root().join("target/package/foo-0.0.1.crate").is_file()); p.cargo("package -l") @@ -637,12 +631,11 @@ fn repackage_on_source_change() { "\ [WARNING] [..] See [..] -[PACKAGING] foo v0.0.1 ({dir}) -[VERIFYING] foo v0.0.1 ({dir}) -[COMPILING] foo v0.0.1 ({dir}[..]) +[PACKAGING] foo v0.0.1 (CWD) +[VERIFYING] foo v0.0.1 (CWD) +[COMPILING] foo v0.0.1 (CWD[..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); // Check that the tarball contains the added file @@ -1111,12 +1104,11 @@ fn package_lockfile() { "\ [WARNING] manifest has no documentation[..] See [..] -[PACKAGING] foo v0.0.1 ({dir}) -[VERIFYING] foo v0.0.1 ({dir}) -[COMPILING] foo v0.0.1 ({dir}[..]) +[PACKAGING] foo v0.0.1 (CWD) +[VERIFYING] foo v0.0.1 (CWD) +[COMPILING] foo v0.0.1 (CWD[..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); assert!(p.root().join("target/package/foo-0.0.1.crate").is_file()); p.cargo("package -l") diff --git a/tests/testsuite/patch.rs b/tests/testsuite/patch.rs index 1bafae4c7d1..77ab42d0bbe 100644 --- a/tests/testsuite/patch.rs +++ b/tests/testsuite/patch.rs @@ -52,9 +52,9 @@ fn replace() { "\ [UPDATING] registry `file://[..]` [DOWNLOADING] baz v0.1.0 ([..]) -[COMPILING] bar v0.1.0 (file://[..]) +[COMPILING] bar v0.1.0 (CWD/bar) [COMPILING] baz v0.1.0 -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -92,8 +92,8 @@ fn nonexistent() { .with_stderr( "\ [UPDATING] registry `file://[..]` -[COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] bar v0.1.0 (CWD/bar) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -136,8 +136,8 @@ fn patch_git() { .with_stderr( "\ [UPDATING] git repository `file://[..]` -[COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] bar v0.1.0 (CWD/bar) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -182,7 +182,7 @@ fn patch_to_git() { [UPDATING] git repository `file://[..]` [UPDATING] registry `file://[..]` [COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -219,7 +219,7 @@ fn unused() { [UPDATING] registry `file://[..]` [DOWNLOADING] bar v0.1.0 [..] [COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -277,7 +277,7 @@ fn unused_git() { [UPDATING] registry `file://[..]` [DOWNLOADING] bar v0.1.0 [..] [COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -311,7 +311,7 @@ fn add_patch() { [UPDATING] registry `file://[..]` [DOWNLOADING] bar v0.1.0 [..] [COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -335,8 +335,8 @@ fn add_patch() { p.cargo("build") .with_stderr( "\ -[COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] bar v0.1.0 (CWD/bar) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -370,7 +370,7 @@ fn add_ignored_patch() { [UPDATING] registry `file://[..]` [DOWNLOADING] bar v0.1.0 [..] [COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -426,7 +426,7 @@ fn new_minor() { "\ [UPDATING] registry `file://[..]` [COMPILING] bar v0.1.1 [..] -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -474,7 +474,7 @@ fn transitive_new_minor() { [UPDATING] registry `file://[..]` [COMPILING] baz v0.1.1 [..] [COMPILING] bar v0.1.0 [..] -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -509,7 +509,7 @@ fn new_major() { "\ [UPDATING] registry `file://[..]` [COMPILING] bar v0.2.0 [..] -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -537,7 +537,7 @@ fn new_major() { [UPDATING] registry `file://[..]` [DOWNLOADING] bar v0.2.0 [..] [COMPILING] bar v0.2.0 -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); @@ -585,7 +585,7 @@ fn transitive_new_major() { [UPDATING] registry `file://[..]` [COMPILING] baz v0.2.0 [..] [COMPILING] bar v0.1.0 [..] -[COMPILING] foo v0.0.1 (file://[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ).run(); diff --git a/tests/testsuite/path.rs b/tests/testsuite/path.rs index 6e0739b165a..9b3e16d0b7e 100644 --- a/tests/testsuite/path.rs +++ b/tests/testsuite/path.rs @@ -65,14 +65,11 @@ fn cargo_compile_with_nested_deps_shorthand() { p.cargo("build") .with_stderr(&format!( - "[COMPILING] baz v0.5.0 ({}/bar/baz)\n\ - [COMPILING] bar v0.5.0 ({}/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] baz v0.5.0 (CWD/bar/baz)\n\ + [COMPILING] bar v0.5.0 (CWD/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - p.url(), - p.url(), - p.url() )).run(); assert!(p.bin("foo").is_file()); @@ -84,20 +81,17 @@ fn cargo_compile_with_nested_deps_shorthand() { println!("building baz"); p.cargo("build -p baz") .with_stderr(&format!( - "[COMPILING] baz v0.5.0 ({}/bar/baz)\n\ + "[COMPILING] baz v0.5.0 (CWD/bar/baz)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - p.url() )).run(); println!("building foo"); p.cargo("build -p foo") .with_stderr(&format!( - "[COMPILING] bar v0.5.0 ({}/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] bar v0.5.0 (CWD/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - p.url(), - p.url() )).run(); } @@ -229,12 +223,10 @@ fn cargo_compile_with_transitive_dev_deps() { p.cargo("build") .with_stderr(&format!( - "[COMPILING] bar v0.5.0 ({}/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] bar v0.5.0 (CWD/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in \ [..]\n", - p.url(), - p.url() )).run(); assert!(p.bin("foo").is_file()); @@ -264,12 +256,10 @@ fn no_rebuild_dependency() { // First time around we should compile both foo and bar p.cargo("build") .with_stderr(&format!( - "[COMPILING] bar v0.5.0 ({}/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] bar v0.5.0 (CWD/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - p.url(), - p.url() )).run(); sleep_ms(1000); @@ -328,14 +318,11 @@ fn deep_dependencies_trigger_rebuild() { .build(); p.cargo("build") .with_stderr(&format!( - "[COMPILING] baz v0.5.0 ({}/baz)\n\ - [COMPILING] bar v0.5.0 ({}/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] baz v0.5.0 (CWD/baz)\n\ + [COMPILING] bar v0.5.0 (CWD/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - p.url(), - p.url(), - p.url() )).run(); p.cargo("build").with_stdout("").run(); @@ -350,14 +337,11 @@ fn deep_dependencies_trigger_rebuild() { .unwrap(); p.cargo("build") .with_stderr(&format!( - "[COMPILING] baz v0.5.0 ({}/baz)\n\ - [COMPILING] bar v0.5.0 ({}/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] baz v0.5.0 (CWD/baz)\n\ + [COMPILING] bar v0.5.0 (CWD/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - p.url(), - p.url(), - p.url() )).run(); // Make sure an update to bar doesn't trigger baz @@ -372,12 +356,10 @@ fn deep_dependencies_trigger_rebuild() { ).unwrap(); p.cargo("build") .with_stderr(&format!( - "[COMPILING] bar v0.5.0 ({}/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] bar v0.5.0 (CWD/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - p.url(), - p.url() )).run(); } @@ -419,14 +401,11 @@ fn no_rebuild_two_deps() { .build(); p.cargo("build") .with_stderr(&format!( - "[COMPILING] baz v0.5.0 ({}/baz)\n\ - [COMPILING] bar v0.5.0 ({}/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] baz v0.5.0 (CWD/baz)\n\ + [COMPILING] bar v0.5.0 (CWD/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - p.url(), - p.url(), - p.url() )).run(); assert!(p.bin("foo").is_file()); p.cargo("build").with_stdout("").run(); @@ -454,16 +433,13 @@ fn nested_deps_recompile() { .file("src/bar/Cargo.toml", &basic_lib_manifest("bar")) .file("src/bar/src/bar.rs", "pub fn gimme() -> i32 { 92 }") .build(); - let bar = p.url(); p.cargo("build") .with_stderr(&format!( - "[COMPILING] bar v0.5.0 ({}/src/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] bar v0.5.0 (CWD/src/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - bar, - p.url() )).run(); sleep_ms(1000); @@ -475,10 +451,9 @@ fn nested_deps_recompile() { // This shouldn't recompile `bar` p.cargo("build") .with_stderr(&format!( - "[COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - p.url() )).run(); } @@ -509,7 +484,7 @@ fn error_message_for_missing_manifest() { [ERROR] failed to load source for a dependency on `bar` Caused by: - Unable to update file://[..] + Unable to update CWD/src/bar Caused by: failed to read `[..]bar/Cargo.toml` @@ -686,12 +661,10 @@ fn path_dep_build_cmd() { p.cargo("build") .with_stderr(&format!( - "[COMPILING] bar v0.5.0 ({}/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] bar v0.5.0 (CWD/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in \ [..]\n", - p.url(), - p.url() )).run(); assert!(p.bin("foo").is_file()); @@ -708,12 +681,10 @@ fn path_dep_build_cmd() { p.cargo("build") .with_stderr(&format!( - "[COMPILING] bar v0.5.0 ({}/bar)\n\ - [COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] bar v0.5.0 (CWD/bar)\n\ + [COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in \ [..]\n", - p.url(), - p.url() )).run(); p.process(&p.bin("foo")).with_stdout("1\n").run(); @@ -749,20 +720,18 @@ fn dev_deps_no_rebuild_lib() { p.cargo("build") .env("FOO", "bar") .with_stderr(&format!( - "[COMPILING] foo v0.5.0 ({})\n\ + "[COMPILING] foo v0.5.0 (CWD)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", - p.url() )).run(); p.cargo("test") .with_stderr(&format!( "\ -[COMPILING] [..] v0.5.0 ({url}[..]) -[COMPILING] [..] v0.5.0 ({url}[..]) +[COMPILING] [..] v0.5.0 (CWD[..]) +[COMPILING] [..] v0.5.0 (CWD[..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE]", - url = p.url() )).with_stdout_contains("running 0 tests") .run(); } diff --git a/tests/testsuite/profile_config.rs b/tests/testsuite/profile_config.rs index 0f1cf68fb1b..a37f647fc8b 100644 --- a/tests/testsuite/profile_config.rs +++ b/tests/testsuite/profile_config.rs @@ -94,7 +94,7 @@ fn profile_config_error_paths() { .with_status(101) .with_stderr( "\ -[ERROR] failed to parse manifest at `[..]foo/Cargo.toml` +[ERROR] failed to parse manifest at `CWD/Cargo.toml` Caused by: error in [..].cargo/config: `profile.dev.rpath` expected true/false, but found a string @@ -128,7 +128,7 @@ fn profile_config_validate_errors() { .with_status(101) .with_stderr( "\ -[ERROR] failed to parse manifest at `[..]foo/Cargo.toml` +[ERROR] failed to parse manifest at `CWD/Cargo.toml` Caused by: config profile `profile.dev` is not valid diff --git a/tests/testsuite/profiles.rs b/tests/testsuite/profiles.rs index f8bb9723205..af386a09855 100644 --- a/tests/testsuite/profiles.rs +++ b/tests/testsuite/profiles.rs @@ -25,7 +25,7 @@ fn profile_overrides() { p.cargo("build -v") .with_stderr(&format!( "\ -[COMPILING] test v0.0.0 ({url}) +[COMPILING] test v0.0.0 (CWD) [RUNNING] `rustc --crate-name test src/lib.rs --crate-type lib \ --emit=dep-info,link \ -C opt-level=1 \ @@ -33,11 +33,9 @@ fn profile_overrides() { -C metadata=[..] \ -C rpath \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [FINISHED] dev [optimized] target(s) in [..] ", - dir = p.root().display(), - url = p.url(), )).run(); } @@ -61,17 +59,15 @@ fn opt_level_override_0() { p.cargo("build -v") .with_stderr(&format!( "\ -[COMPILING] test v0.0.0 ({url}) +[COMPILING] test v0.0.0 (CWD) [RUNNING] `rustc --crate-name test src/lib.rs --crate-type lib \ --emit=dep-info,link \ -C debuginfo=2 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [FINISHED] [..] target(s) in [..] ", - dir = p.root().display(), - url = p.url() )).run(); } @@ -94,17 +90,15 @@ fn debug_override_1() { p.cargo("build -v") .with_stderr(&format!( "\ -[COMPILING] test v0.0.0 ({url}) +[COMPILING] test v0.0.0 (CWD) [RUNNING] `rustc --crate-name test src/lib.rs --crate-type lib \ --emit=dep-info,link \ -C debuginfo=1 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [FINISHED] [..] target(s) in [..] ", - dir = p.root().display(), - url = p.url() )).run(); } @@ -130,7 +124,7 @@ fn check_opt_level_override(profile_level: &str, rustc_level: &str) { p.cargo("build -v") .with_stderr(&format!( "\ -[COMPILING] test v0.0.0 ({url}) +[COMPILING] test v0.0.0 (CWD) [RUNNING] `rustc --crate-name test src/lib.rs --crate-type lib \ --emit=dep-info,link \ -C opt-level={level} \ @@ -138,11 +132,9 @@ fn check_opt_level_override(profile_level: &str, rustc_level: &str) { -C debug-assertions=on \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [FINISHED] [..] target(s) in [..] ", - dir = p.root().display(), - url = p.url(), level = rustc_level )).run(); } @@ -206,7 +198,7 @@ fn top_level_overrides_deps() { p.cargo("build -v --release") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.0 ({url}/foo) +[COMPILING] foo v0.0.0 (CWD/foo) [RUNNING] `rustc --crate-name foo foo/src/lib.rs \ --crate-type dylib --crate-type rlib \ --emit=dep-info,link \ @@ -214,23 +206,21 @@ fn top_level_overrides_deps() { -C opt-level=1 \ -C debuginfo=2 \ -C metadata=[..] \ - --out-dir {dir}/target/release/deps \ - -L dependency={dir}/target/release/deps` -[COMPILING] test v0.0.0 ({url}) + --out-dir CWD/target/release/deps \ + -L dependency=CWD/target/release/deps` +[COMPILING] test v0.0.0 (CWD) [RUNNING] `rustc --crate-name test src/lib.rs --crate-type lib \ --emit=dep-info,link \ -C opt-level=1 \ -C debuginfo=2 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/release/deps \ - --extern foo={dir}/target/release/deps/\ + -L dependency=CWD/target/release/deps \ + --extern foo=CWD/target/release/deps/\ {prefix}foo[..]{suffix} \ - --extern foo={dir}/target/release/deps/libfoo.rlib` + --extern foo=CWD/target/release/deps/libfoo.rlib` [FINISHED] release [optimized + debuginfo] target(s) in [..] ", - dir = p.root().display(), - url = p.url(), prefix = env::consts::DLL_PREFIX, suffix = env::consts::DLL_SUFFIX )).run(); diff --git a/tests/testsuite/publish.rs b/tests/testsuite/publish.rs index d2e8ac2d890..17fd41cbab2 100644 --- a/tests/testsuite/publish.rs +++ b/tests/testsuite/publish.rs @@ -33,10 +33,9 @@ fn simple() { [UPDATING] registry `{reg}` [WARNING] manifest has no documentation, [..] See [..] -[PACKAGING] foo v0.0.1 ({dir}) -[UPLOADING] foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 (CWD) +[UPLOADING] foo v0.0.1 (CWD) ", - dir = p.url(), reg = publish::registry() )).run(); @@ -107,10 +106,9 @@ fn old_token_location() { [UPDATING] registry `{reg}` [WARNING] manifest has no documentation, [..] See [..] -[PACKAGING] foo v0.0.1 ({dir}) -[UPLOADING] foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 (CWD) +[UPLOADING] foo v0.0.1 (CWD) ", - dir = p.url(), reg = publish::registry() )).run(); @@ -183,10 +181,9 @@ about this warning. [UPDATING] registry `{reg}` [WARNING] manifest has no documentation, [..] See [..] -[PACKAGING] foo v0.0.1 ({dir}) -[UPLOADING] foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 (CWD) +[UPLOADING] foo v0.0.1 (CWD) ", - dir = p.url(), reg = publish::registry() )).run(); @@ -261,10 +258,9 @@ about this warning. [UPDATING] registry `{reg}` [WARNING] manifest has no documentation, [..] See [..] -[PACKAGING] foo v0.0.1 ({dir}) -[UPLOADING] foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 (CWD) +[UPLOADING] foo v0.0.1 (CWD) ", - dir = p.url(), reg = publish::registry() )).run(); @@ -608,14 +604,13 @@ fn dry_run() { [UPDATING] registry `[..]` [WARNING] manifest has no documentation, [..] See [..] -[PACKAGING] foo v0.0.1 ({dir}) -[VERIFYING] foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 (CWD) +[VERIFYING] foo v0.0.1 (CWD) [COMPILING] foo v0.0.1 [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] -[UPLOADING] foo v0.0.1 ({dir}) +[UPLOADING] foo v0.0.1 (CWD) [WARNING] aborting upload due to dry run ", - dir = p.url() )).run(); // Ensure the API request wasn't actually made diff --git a/tests/testsuite/registry.rs b/tests/testsuite/registry.rs index cb401e37c45..bd4b42e7760 100644 --- a/tests/testsuite/registry.rs +++ b/tests/testsuite/registry.rs @@ -42,10 +42,9 @@ fn simple() { [UPDATING] registry `{reg}` [DOWNLOADING] bar v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url(), reg = registry::registry() )).run(); @@ -56,10 +55,9 @@ fn simple() { .with_stderr(&format!( "\ [COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); } @@ -91,10 +89,9 @@ fn deps() { [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 [COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url(), reg = registry::registry() )).run(); } @@ -317,10 +314,9 @@ required by package `foo v0.0.1 ([..])` [UPDATING] registry `{reg}` [DOWNLOADING] notyet v0.0.1 (registry `file://[..]`) [COMPILING] notyet v0.0.1 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url(), reg = registry::registry() )).run(); } @@ -368,15 +364,14 @@ required by package `foo v0.0.1 ([..])` p.cargo("package") .with_stderr(format!( "\ -[PACKAGING] foo v0.0.1 ({dir}) -[VERIFYING] foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 (CWD) +[VERIFYING] foo v0.0.1 (CWD) [UPDATING] registry `[..]` [DOWNLOADING] notyet v0.0.1 (registry `file://[..]`) [COMPILING] notyet v0.0.1 -[COMPILING] foo v0.0.1 ({dir}[..]) +[COMPILING] foo v0.0.1 (CWD[..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); } @@ -405,10 +400,9 @@ fn lockfile_locks() { [UPDATING] registry `[..]` [DOWNLOADING] bar v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); p.root().move_into_the_past(); @@ -445,10 +439,9 @@ fn lockfile_locks_transitively() { [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 [COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); p.root().move_into_the_past(); @@ -491,10 +484,9 @@ fn yanks_are_not_used() { [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 [COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); } @@ -640,10 +632,9 @@ fn update_lockfile() { "\ [DOWNLOADING] [..] v0.0.2 (registry `file://[..]`) [COMPILING] bar v0.0.2 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); println!("0.0.3 update"); @@ -661,10 +652,9 @@ fn update_lockfile() { "\ [DOWNLOADING] [..] v0.0.3 (registry `file://[..]`) [COMPILING] bar v0.0.3 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); println!("new dependencies update"); @@ -740,10 +730,9 @@ fn dev_dependency_not_used() { [UPDATING] registry `[..]` [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); } @@ -825,11 +814,10 @@ fn updating_a_dep() { [UPDATING] registry `[..]` [DOWNLOADING] bar v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 -[COMPILING] a v0.0.1 ({dir}/a) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] a v0.0.1 (CWD/a) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); t!(t!(File::create(&p.root().join("a/Cargo.toml"))).write_all( @@ -852,11 +840,10 @@ fn updating_a_dep() { [UPDATING] registry `[..]` [DOWNLOADING] bar v0.1.0 (registry `file://[..]`) [COMPILING] bar v0.1.0 -[COMPILING] a v0.0.1 ({dir}/a) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] a v0.0.1 (CWD/a) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); } @@ -908,10 +895,9 @@ fn git_and_registry_dep() { [DOWNLOADING] a v0.0.1 (registry `file://[..]`) [COMPILING] a v0.0.1 [COMPILING] b v0.0.1 ([..]) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); p.root().move_into_the_past(); @@ -981,10 +967,9 @@ fn update_publish_then_update() { [UPDATING] [..] [DOWNLOADING] a v0.1.1 (registry `file://[..]`) [COMPILING] a v0.1.1 -[COMPILING] foo v0.5.0 ({dir}) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", - dir = p.url() )).run(); } diff --git a/tests/testsuite/rename_deps.rs b/tests/testsuite/rename_deps.rs index 7e915f3c9f2..a61f4607215 100644 --- a/tests/testsuite/rename_deps.rs +++ b/tests/testsuite/rename_deps.rs @@ -331,13 +331,12 @@ fn can_run_doc_tests() { .with_stderr_contains(format!( "\ [DOCTEST] foo -[RUNNING] `rustdoc --test {dir}/src/lib.rs \ +[RUNNING] `rustdoc --test CWD/src/lib.rs \ [..] \ - --extern baz={dir}/target/debug/deps/libbar-[..].rlib \ - --extern bar={dir}/target/debug/deps/libbar-[..].rlib \ + --extern baz=CWD/target/debug/deps/libbar-[..].rlib \ + --extern bar=CWD/target/debug/deps/libbar-[..].rlib \ [..]` ", - dir = foo.root().display(), )).run(); } diff --git a/tests/testsuite/required_features.rs b/tests/testsuite/required_features.rs index 730ef0479bd..8f5c7418bc2 100644 --- a/tests/testsuite/required_features.rs +++ b/tests/testsuite/required_features.rs @@ -274,10 +274,9 @@ fn test_default_features() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE]", - p.url() )).with_stdout_contains("test test ... ok") .run(); @@ -328,10 +327,9 @@ fn test_arg_features() { p.cargo("test --features a") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE]", - p.url() )).with_stdout_contains("test test ... ok") .run(); } @@ -368,21 +366,19 @@ fn test_multiple_required_features() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo_2-[..][EXE]", - p.url() )).with_stdout_contains("test test ... ok") .run(); p.cargo("test --features c") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo_1-[..][EXE] [RUNNING] target/debug/deps/foo_2-[..][EXE]", - p.url() )).with_stdout_contains_n("test test ... ok", 2) .run(); @@ -429,10 +425,9 @@ fn bench_default_features() { p.cargo("bench") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE]", - p.url() )).with_stdout_contains("test bench ... bench: [..]") .run(); @@ -495,10 +490,9 @@ fn bench_arg_features() { p.cargo("bench --features a") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE]", - p.url() )).with_stdout_contains("test bench ... bench: [..]") .run(); } @@ -555,21 +549,19 @@ fn bench_multiple_required_features() { p.cargo("bench") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo_2-[..][EXE]", - p.url() )).with_stdout_contains("test bench ... bench: [..]") .run(); p.cargo("bench --features c") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo_1-[..][EXE] [RUNNING] target/release/deps/foo_2-[..][EXE]", - p.url() )).with_stdout_contains_n("test bench ... bench: [..]", 2) .run(); @@ -810,24 +802,22 @@ fn dep_feature_in_toml() { p.cargo("test --test=foo") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE]", - p.url() )).with_stdout_contains("test test ... ok") .run(); // bench if is_nightly() { p.cargo("bench --bench=foo") - .with_stderr(format!( + .with_stderr( "\ -[COMPILING] bar v0.0.1 ({0}/bar) -[COMPILING] foo v0.0.1 ({0}) +[COMPILING] bar v0.0.1 (CWD/bar) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE]", - p.url() - )).with_stdout_contains("test bench ... bench: [..]") + ).with_stdout_contains("test bench ... bench: [..]") .run(); } @@ -930,10 +920,9 @@ Consider enabling them by passing e.g. `--features=\"bar/a\"` p.cargo("test --test=foo --features bar/a") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE]", - p.url() )).with_stdout_contains("test test ... ok") .run(); @@ -945,14 +934,13 @@ Consider enabling them by passing e.g. `--features=\"bar/a\"` .run(); p.cargo("bench --bench=foo --features bar/a") - .with_stderr(format!( + .with_stderr( "\ -[COMPILING] bar v0.0.1 ({0}/bar) -[COMPILING] foo v0.0.1 ({0}) +[COMPILING] bar v0.0.1 (CWD/bar) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE]", - p.url() - )).with_stdout_contains("test bench ... bench: [..]") + ).with_stdout_contains("test bench ... bench: [..]") .run(); } @@ -1000,10 +988,9 @@ fn test_skips_compiling_bin_with_missing_required_features() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE]", - p.url() )).with_stdout_contains("running 0 tests") .run(); @@ -1011,30 +998,27 @@ fn test_skips_compiling_bin_with_missing_required_features() { .with_status(101) .with_stderr_contains(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) error[E0463]: can't find crate for `bar`", - p.url() )).run(); if is_nightly() { p.cargo("bench") - .with_stderr(format!( + .with_stderr( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] target/release/deps/foo-[..][EXE]", - p.url() - )).with_stdout_contains("running 0 tests") + ).with_stdout_contains("running 0 tests") .run(); p.cargo("bench --features a -j 1") .with_status(101) - .with_stderr_contains(format!( + .with_stderr_contains( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) error[E0463]: can't find crate for `bar`", - p.url() - )).run(); + ).run(); } } diff --git a/tests/testsuite/run.rs b/tests/testsuite/run.rs index 7f7004f2a04..2a534359e3c 100644 --- a/tests/testsuite/run.rs +++ b/tests/testsuite/run.rs @@ -1,6 +1,6 @@ use cargo::util::paths::dylib_path_envvar; use support; -use support::{basic_bin_manifest, basic_lib_manifest, path2url, project, Project}; +use support::{basic_bin_manifest, basic_lib_manifest, project, Project}; #[test] fn simple() { @@ -11,10 +11,9 @@ fn simple() { p.cargo("run") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/foo[EXE]`", - dir = path2url(p.root()) )).with_stdout("hello") .run(); assert!(p.bin("foo").is_file()); @@ -82,7 +81,7 @@ fn exit_code() { let mut output = String::from( "\ -[COMPILING] foo v0.0.1 (file[..]) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target[..]` ", @@ -103,7 +102,7 @@ fn exit_code_verbose() { let mut output = String::from( "\ -[COMPILING] foo v0.0.1 (file[..]) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target[..]` @@ -182,12 +181,11 @@ fn specify_name() { p.cargo("run --bin a -v") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc [..] src/lib.rs [..]` [RUNNING] `rustc [..] src/bin/a.rs [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/a[EXE]`", - dir = path2url(p.root()) )).with_stdout("hello a.rs") .run(); @@ -320,10 +318,9 @@ fn run_example() { p.cargo("run --example a") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/examples/a[EXE]`", - dir = path2url(p.root()) )).with_stdout("example") .run(); } @@ -433,10 +430,9 @@ fn run_example_autodiscover_2015_with_autoexamples_enabled() { .masquerade_as_nightly_cargo() .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/examples/a[EXE]`", - dir = path2url(p.root()) )).with_stdout("example") .run(); } @@ -466,10 +462,9 @@ fn run_example_autodiscover_2018() { .masquerade_as_nightly_cargo() .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/examples/a[EXE]`", - dir = path2url(p.root()) )).with_stdout("example") .run(); } @@ -561,10 +556,9 @@ fn one_bin_multiple_examples() { p.cargo("run") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/main[EXE]`", - dir = path2url(p.root()) )).with_stdout("hello main.rs") .run(); } @@ -615,26 +609,24 @@ fn example_with_release_flag() { p.cargo("run -v --release --example a") .with_stderr(&format!( "\ -[COMPILING] bar v0.5.0 ({url}/bar) +[COMPILING] bar v0.5.0 (CWD/bar) [RUNNING] `rustc --crate-name bar bar/src/bar.rs --crate-type lib \ --emit=dep-info,link \ -C opt-level=3 \ -C metadata=[..] \ - --out-dir {dir}/target/release/deps \ - -L dependency={dir}/target/release/deps` -[COMPILING] foo v0.0.1 ({url}) + --out-dir CWD/target/release/deps \ + -L dependency=CWD/target/release/deps` +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc --crate-name a examples/a.rs --crate-type bin \ --emit=dep-info,link \ -C opt-level=3 \ -C metadata=[..] \ - --out-dir {dir}/target/release/examples \ - -L dependency={dir}/target/release/deps \ - --extern bar={dir}/target/release/deps/libbar-[..].rlib` + --out-dir CWD/target/release/examples \ + -L dependency=CWD/target/release/deps \ + --extern bar=CWD/target/release/deps/libbar-[..].rlib` [FINISHED] release [optimized] target(s) in [..] [RUNNING] `target/release/examples/a[EXE]` ", - dir = p.root().display(), - url = path2url(p.root()), )).with_stdout( "\ fast1 @@ -644,26 +636,24 @@ fast2", p.cargo("run -v --example a") .with_stderr(&format!( "\ -[COMPILING] bar v0.5.0 ({url}/bar) +[COMPILING] bar v0.5.0 (CWD/bar) [RUNNING] `rustc --crate-name bar bar/src/bar.rs --crate-type lib \ --emit=dep-info,link \ -C debuginfo=2 \ -C metadata=[..] \ - --out-dir {dir}/target/debug/deps \ - -L dependency={dir}/target/debug/deps` -[COMPILING] foo v0.0.1 ({url}) + --out-dir CWD/target/debug/deps \ + -L dependency=CWD/target/debug/deps` +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc --crate-name a examples/a.rs --crate-type bin \ --emit=dep-info,link \ -C debuginfo=2 \ -C metadata=[..] \ - --out-dir {dir}/target/debug/examples \ - -L dependency={dir}/target/debug/deps \ - --extern bar={dir}/target/debug/deps/libbar-[..].rlib` + --out-dir CWD/target/debug/examples \ + -L dependency=CWD/target/debug/deps \ + --extern bar=CWD/target/debug/deps/libbar-[..].rlib` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `target/debug/examples/a[EXE]` ", - dir = p.root().display(), - url = path2url(p.root()), )).with_stdout( "\ slow1 @@ -719,11 +709,10 @@ fn release_works() { p.cargo("run --release") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] release [optimized] target(s) in [..] [RUNNING] `target/release/foo[EXE]` ", - dir = path2url(p.root()), )).run(); assert!(p.release_bin("foo").is_file()); } diff --git a/tests/testsuite/rustc.rs b/tests/testsuite/rustc.rs index e8ede6e0421..c92fcaff3f0 100644 --- a/tests/testsuite/rustc.rs +++ b/tests/testsuite/rustc.rs @@ -14,16 +14,14 @@ fn build_lib_for_foo() { p.cargo("rustc --lib -v") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({url}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc --crate-name foo src/lib.rs --crate-type lib \ --emit=dep-info,link -C debuginfo=2 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.root().display(), - url = p.url() )).run(); } @@ -37,17 +35,15 @@ fn lib() { p.cargo("rustc --lib -v -- -C debug-assertions=off") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({url}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc --crate-name foo src/lib.rs --crate-type lib \ --emit=dep-info,link -C debuginfo=2 \ -C debug-assertions=off \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.root().display(), - url = p.url() )).run(); } @@ -61,23 +57,21 @@ fn build_main_and_allow_unstable_options() { p.cargo("rustc -v --bin foo -- -C debug-assertions") .with_stderr(&format!( "\ -[COMPILING] {name} v{version} ({url}) +[COMPILING] {name} v{version} (CWD) [RUNNING] `rustc --crate-name {name} src/lib.rs --crate-type lib \ --emit=dep-info,link -C debuginfo=2 \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [RUNNING] `rustc --crate-name {name} src/main.rs --crate-type bin \ --emit=dep-info,link -C debuginfo=2 \ -C debug-assertions \ -C metadata=[..] \ --out-dir [..] \ - -L dependency={dir}/target/debug/deps \ - --extern {name}={dir}/target/debug/deps/lib{name}-[..].rlib` + -L dependency=CWD/target/debug/deps \ + --extern {name}=CWD/target/debug/deps/lib{name}-[..].rlib` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.root().display(), - url = p.url(), name = "foo", version = "0.0.1" )).run(); @@ -108,7 +102,7 @@ fn build_with_args_to_one_of_multiple_binaries() { p.cargo("rustc -v --bin bar -- -C debug-assertions") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({url}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc --crate-name foo src/lib.rs --crate-type lib --emit=dep-info,link \ -C debuginfo=2 -C metadata=[..] \ --out-dir [..]` @@ -116,7 +110,6 @@ fn build_with_args_to_one_of_multiple_binaries() { -C debuginfo=2 -C debug-assertions [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = p.url() )).run(); } @@ -147,7 +140,7 @@ fn build_with_args_to_one_of_multiple_tests() { p.cargo("rustc -v --test bar -- -C debug-assertions") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({url}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc --crate-name foo src/lib.rs --crate-type lib --emit=dep-info,link \ -C debuginfo=2 -C metadata=[..] \ --out-dir [..]` @@ -155,7 +148,6 @@ fn build_with_args_to_one_of_multiple_tests() { -C debug-assertions [..]--test[..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = p.url() )).run(); } @@ -186,11 +178,10 @@ fn build_foo_with_bar_dependency() { "\ [COMPILING] bar v0.1.0 ([..]) [RUNNING] `[..] -C debuginfo=2 [..]` -[COMPILING] foo v0.0.1 ({url}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `[..] -C debuginfo=2 -C debug-assertions [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = foo.url() )).run(); } diff --git a/tests/testsuite/rustdoc.rs b/tests/testsuite/rustdoc.rs index d5ddca20923..b53121a9ef2 100644 --- a/tests/testsuite/rustdoc.rs +++ b/tests/testsuite/rustdoc.rs @@ -7,14 +7,12 @@ fn rustdoc_simple() { p.cargo("rustdoc -v") .with_stderr(format!( "\ -[DOCUMENTING] foo v0.0.1 ({url}) +[DOCUMENTING] foo v0.0.1 (CWD) [RUNNING] `rustdoc --crate-name foo src/lib.rs \ - -o {dir}/target/doc \ - -L dependency={dir}/target/debug/deps` + -o CWD/target/doc \ + -L dependency=CWD/target/debug/deps` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.root().display(), - url = p.url() )).run(); } @@ -25,15 +23,13 @@ fn rustdoc_args() { p.cargo("rustdoc -v -- --cfg=foo") .with_stderr(format!( "\ -[DOCUMENTING] foo v0.0.1 ({url}) +[DOCUMENTING] foo v0.0.1 (CWD) [RUNNING] `rustdoc --crate-name foo src/lib.rs \ - -o {dir}/target/doc \ + -o CWD/target/doc \ --cfg=foo \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.root().display(), - url = p.url() )).run(); } @@ -64,16 +60,14 @@ fn rustdoc_foo_with_bar_dependency() { "\ [CHECKING] bar v0.0.1 ([..]) [RUNNING] `rustc [..]bar/src/lib.rs [..]` -[DOCUMENTING] foo v0.0.1 ({url}) +[DOCUMENTING] foo v0.0.1 (CWD) [RUNNING] `rustdoc --crate-name foo src/lib.rs \ - -o {dir}/target/doc \ + -o CWD/target/doc \ --cfg=foo \ - -L dependency={dir}/target/debug/deps \ + -L dependency=CWD/target/debug/deps \ --extern [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = foo.root().display(), - url = foo.url() )).run(); } @@ -104,12 +98,11 @@ fn rustdoc_only_bar_dependency() { "\ [DOCUMENTING] bar v0.0.1 ([..]) [RUNNING] `rustdoc --crate-name bar [..]bar/src/lib.rs \ - -o {dir}/target/doc \ + -o CWD/target/doc \ --cfg=foo \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = foo.root().display() )).run(); } @@ -125,12 +118,11 @@ fn rustdoc_same_name_documents_lib() { "\ [DOCUMENTING] foo v0.0.1 ([..]) [RUNNING] `rustdoc --crate-name foo src/lib.rs \ - -o {dir}/target/doc \ + -o CWD/target/doc \ --cfg=foo \ - -L dependency={dir}/target/debug/deps` + -L dependency=CWD/target/debug/deps` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.root().display() )).run(); } @@ -171,9 +163,9 @@ fn rustdoc_target() { [DOCUMENTING] foo v0.0.1 ([..]) [RUNNING] `rustdoc --crate-name foo src/lib.rs \ --target x86_64-unknown-linux-gnu \ - -o [..]foo/target/x86_64-unknown-linux-gnu/doc \ - -L dependency=[..]foo/target/x86_64-unknown-linux-gnu/debug/deps \ - -L dependency=[..]foo/target/debug/deps` + -o CWD/target/x86_64-unknown-linux-gnu/doc \ + -L dependency=CWD/target/x86_64-unknown-linux-gnu/debug/deps \ + -L dependency=CWD/target/debug/deps` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ).run(); } diff --git a/tests/testsuite/search.rs b/tests/testsuite/search.rs index 484a5c5feb8..29a309da579 100644 --- a/tests/testsuite/search.rs +++ b/tests/testsuite/search.rs @@ -143,7 +143,7 @@ fn simple_with_host() { setup(); cargo_process("search postgres --host").arg(registry_url().to_string()) - .with_stderr(&format!( + .with_stderr( "\ [WARNING] The flag '--host' is no longer valid. @@ -154,10 +154,9 @@ wants the location of the index. Please use '--index' instead. This will soon become a hard error, so it's either recommended to update to a fixed version or contact the upstream maintainer about this warning. -[UPDATING] registry `{reg}` +[UPDATING] registry `CWD/registry` ", - reg = registry_url() - )) + ) .with_stdout_contains( "hoare = \"0.1.1\" # Design by contract style assertions for Rust", ) @@ -171,7 +170,7 @@ fn simple_with_index_and_host() { setup(); cargo_process("search postgres --index").arg(registry_url().to_string()).arg("--host").arg(registry_url().to_string()) - .with_stderr(&format!( + .with_stderr( "\ [WARNING] The flag '--host' is no longer valid. @@ -182,10 +181,9 @@ wants the location of the index. Please use '--index' instead. This will soon become a hard error, so it's either recommended to update to a fixed version or contact the upstream maintainer about this warning. -[UPDATING] registry `{reg}` +[UPDATING] registry `CWD/registry` ", - reg = registry_url() - )) + ) .with_stdout_contains( "hoare = \"0.1.1\" # Design by contract style assertions for Rust", ) diff --git a/tests/testsuite/support/mod.rs b/tests/testsuite/support/mod.rs index cd7680947e6..e898a96d3f6 100644 --- a/tests/testsuite/support/mod.rs +++ b/tests/testsuite/support/mod.rs @@ -950,6 +950,16 @@ impl Execs { // Let's not deal with \r\n vs \n on windows... let actual = actual.replace("\r", ""); let actual = actual.replace("\t", ""); + let actual = match self.process_builder { + None => actual, + Some(ref p) => match p.get_cwd() { + None => actual, + Some(cwd) => actual + .replace(&path2url(cwd).to_string(), "CWD") + .replace(&cwd.display().to_string(), "CWD") + , + }, + }; match kind { MatchKind::Exact => { diff --git a/tests/testsuite/test.rs b/tests/testsuite/test.rs index 121e1c69427..e05cbd2a55d 100644 --- a/tests/testsuite/test.rs +++ b/tests/testsuite/test.rs @@ -36,10 +36,9 @@ fn cargo_test_simple() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.5.0 ({}) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE]", - p.url() )).with_stdout_contains("test test_hello ... ok") .run(); } @@ -82,9 +81,9 @@ fn cargo_test_release() { p.cargo("test -v --release") .with_stderr(format!( "\ -[COMPILING] bar v0.0.1 ({dir}/bar) +[COMPILING] bar v0.0.1 (CWD/bar) [RUNNING] [..] -C opt-level=3 [..] -[COMPILING] foo v0.1.0 ({dir}) +[COMPILING] foo v0.1.0 (CWD) [RUNNING] [..] -C opt-level=3 [..] [RUNNING] [..] -C opt-level=3 [..] [RUNNING] [..] -C opt-level=3 [..] @@ -93,7 +92,6 @@ fn cargo_test_release() { [RUNNING] `[..]target/release/deps/test-[..][EXE]` [DOCTEST] foo [RUNNING] `rustdoc --test [..]lib.rs[..]`", - dir = p.url() )).with_stdout_contains_n("test test ... ok", 2) .with_stdout_contains("running 0 tests") .run(); @@ -152,11 +150,10 @@ fn cargo_test_verbose() { p.cargo("test -v hello") .with_stderr(format!( "\ -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc [..] src/main.rs [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `[..]target/debug/deps/foo-[..][EXE] hello`", - url = p.url() )).with_stdout_contains("test test_hello ... ok") .run(); } @@ -221,11 +218,10 @@ fn cargo_test_failing_test_in_bin() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [ERROR] test failed, to rerun pass '--bin foo'", - url = p.url() )).with_stdout_contains( " running 1 test @@ -266,12 +262,11 @@ fn cargo_test_failing_test_in_test() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [RUNNING] target/debug/deps/footest-[..][EXE] [ERROR] test failed, to rerun pass '--test footest'", - url = p.url() )).with_stdout_contains("running 0 tests") .with_stdout_contains( "\ @@ -303,11 +298,10 @@ fn cargo_test_failing_test_in_lib() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [ERROR] test failed, to rerun pass '--lib'", - url = p.url() )).with_stdout_contains( "\ test test_hello ... FAILED @@ -372,12 +366,11 @@ fn test_with_lib_dep() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [RUNNING] target/debug/deps/baz-[..][EXE] [DOCTEST] foo", - p.url() )).with_stdout_contains("test lib_test ... ok") .with_stdout_contains("test bin_test ... ok") .with_stdout_contains_n("test [..] ... ok", 3) @@ -424,11 +417,10 @@ fn test_with_deep_lib_dep() { .with_stderr(&format!( "\ [COMPILING] bar v0.0.1 ([..]) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target[..] [DOCTEST] foo", - dir = p.url() )).with_stdout_contains("test bar_test ... ok") .with_stdout_contains_n("test [..] ... ok", 2) .run(); @@ -470,12 +462,11 @@ fn external_test_explicit() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [RUNNING] target/debug/deps/test-[..][EXE] [DOCTEST] foo", - p.url() )).with_stdout_contains("test internal_test ... ok") .with_stdout_contains("test external_test ... ok") .with_stdout_contains("running 0 tests") @@ -527,12 +518,11 @@ fn external_test_implicit() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [RUNNING] target/debug/deps/external-[..][EXE] [DOCTEST] foo", - p.url() )).with_stdout_contains("test internal_test ... ok") .with_stdout_contains("test external_test ... ok") .with_stdout_contains("running 0 tests") @@ -566,11 +556,10 @@ fn pass_through_command_line() { p.cargo("test bar") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [DOCTEST] foo", - dir = p.url() )).with_stdout_contains("test bar ... ok") .with_stdout_contains("running 0 tests") .run(); @@ -638,12 +627,11 @@ fn lib_bin_same_name() { p.cargo("test") .with_stderr(format!( "\ -[COMPILING] foo v0.0.1 ({}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [RUNNING] target/debug/deps/foo-[..][EXE] [DOCTEST] foo", - p.url() )).with_stdout_contains_n("test [..] ... ok", 2) .with_stdout_contains("running 0 tests") .run(); @@ -677,12 +665,11 @@ fn lib_with_standard_name() { p.cargo("test") .with_stderr(&format!( "\ -[COMPILING] syntax v0.0.1 ({dir}) +[COMPILING] syntax v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/syntax-[..][EXE] [RUNNING] target/debug/deps/test-[..][EXE] [DOCTEST] syntax", - dir = p.url() )).with_stdout_contains("test foo_test ... ok") .with_stdout_contains("test test ... ok") .with_stdout_contains_n("test [..] ... ok", 3) @@ -721,10 +708,9 @@ fn lib_with_standard_name2() { p.cargo("test") .with_stderr(&format!( "\ -[COMPILING] syntax v0.0.1 ({dir}) +[COMPILING] syntax v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/syntax-[..][EXE]", - dir = p.url() )).with_stdout_contains("test test ... ok") .run(); } @@ -760,10 +746,9 @@ fn lib_without_name() { p.cargo("test") .with_stderr(&format!( "\ -[COMPILING] syntax v0.0.1 ({dir}) +[COMPILING] syntax v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/syntax-[..][EXE]", - dir = p.url() )).with_stdout_contains("test test ... ok") .run(); } @@ -1049,12 +1034,11 @@ fn test_dylib() { p.cargo("test") .with_stderr(&format!( "\ -[COMPILING] bar v0.0.1 ({dir}/bar) -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] bar v0.0.1 (CWD/bar) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [RUNNING] target/debug/deps/test-[..][EXE]", - dir = p.url() )).with_stdout_contains_n("test foo ... ok", 2) .run(); @@ -1088,11 +1072,10 @@ fn test_twice_with_build_cmd() { p.cargo("test") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [DOCTEST] foo", - dir = p.url() )).with_stdout_contains("test foo ... ok") .with_stdout_contains("running 0 tests") .run(); @@ -1115,11 +1098,10 @@ fn test_then_build() { p.cargo("test") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE] [DOCTEST] foo", - dir = p.url() )).with_stdout_contains("test foo ... ok") .with_stdout_contains("running 0 tests") .run(); @@ -1136,10 +1118,9 @@ fn test_no_run() { p.cargo("test --no-run") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); } @@ -1167,13 +1148,12 @@ fn test_run_specific_bin_target() { .build(); prj.cargo("test --bin bin2") - .with_stderr(format!( + .with_stderr( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/bin2-[..][EXE]", - dir = prj.url() - )).with_stdout_contains("test test2 ... ok") + ).with_stdout_contains("test test2 ... ok") .run(); } @@ -1205,13 +1185,12 @@ fn test_run_implicit_bin_target() { ).build(); prj.cargo("test --bins") - .with_stderr(format!( + .with_stderr( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/mybin-[..][EXE]", - dir = prj.url() - )).with_stdout_contains("test test_in_bin ... ok") + ).with_stdout_contains("test test_in_bin ... ok") .run(); } @@ -1225,13 +1204,12 @@ fn test_run_specific_test_target() { .build(); prj.cargo("test --test b") - .with_stderr(format!( + .with_stderr( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/b-[..][EXE]", - dir = prj.url() - )).with_stdout_contains("test test_b ... ok") + ).with_stdout_contains("test test_b ... ok") .run(); } @@ -1262,14 +1240,13 @@ fn test_run_implicit_test_target() { ).build(); prj.cargo("test --tests") - .with_stderr(format!( + .with_stderr( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/mybin-[..][EXE] [RUNNING] target/debug/deps/mytest-[..][EXE]", - dir = prj.url() - )).with_stdout_contains("test test_in_test ... ok") + ).with_stdout_contains("test test_in_test ... ok") .run(); } @@ -1300,14 +1277,13 @@ fn test_run_implicit_bench_target() { ).build(); prj.cargo("test --benches") - .with_stderr(format!( + .with_stderr( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/mybin-[..][EXE] [RUNNING] target/debug/deps/mybench-[..][EXE]", - dir = prj.url() - )).with_stdout_contains("test test_in_bench ... ok") + ).with_stdout_contains("test test_in_bench ... ok") .run(); } @@ -1408,11 +1384,10 @@ fn test_no_harness() { p.cargo("test -- --nocapture") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/bar-[..][EXE] ", - dir = p.url() )).run(); } @@ -1476,11 +1451,10 @@ fn selective_testing() { p.cargo("test -p d1") .with_stderr(&format!( "\ -[COMPILING] d1 v0.0.1 ({dir}/d1) +[COMPILING] d1 v0.0.1 (CWD/d1) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/d1-[..][EXE] [RUNNING] target/debug/deps/d1-[..][EXE]", - dir = p.url() )).with_stdout_contains_n("running 0 tests", 2) .run(); @@ -1488,11 +1462,10 @@ fn selective_testing() { p.cargo("test -p d2") .with_stderr(&format!( "\ -[COMPILING] d2 v0.0.1 ({dir}/d2) +[COMPILING] d2 v0.0.1 (CWD/d2) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/d2-[..][EXE] [RUNNING] target/debug/deps/d2-[..][EXE]", - dir = p.url() )).with_stdout_contains_n("running 0 tests", 2) .run(); @@ -1500,10 +1473,9 @@ fn selective_testing() { p.cargo("test") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/foo-[..][EXE]", - dir = p.url() )).with_stdout_contains("running 0 tests") .run(); } @@ -1669,11 +1641,10 @@ fn selective_testing_with_docs() { p.cargo("test -p d1") .with_stderr(&format!( "\ -[COMPILING] d1 v0.0.1 ({dir}/d1) +[COMPILING] d1 v0.0.1 (CWD/d1) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] target/debug/deps/d1[..][EXE] [DOCTEST] d1", - dir = p.url() )).with_stdout_contains_n("running 0 tests", 2) .run(); } @@ -1688,12 +1659,11 @@ fn example_bin_same_name() { p.cargo("test --no-run -v") .with_stderr(&format!( "\ -[COMPILING] foo v0.0.1 ({dir}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc [..]` [RUNNING] `rustc [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - dir = p.url() )).run(); assert!(!p.bin("foo").is_file()); diff --git a/tests/testsuite/tool_paths.rs b/tests/testsuite/tool_paths.rs index 19c798355e2..63d09a0777d 100644 --- a/tests/testsuite/tool_paths.rs +++ b/tests/testsuite/tool_paths.rs @@ -1,5 +1,5 @@ use support::rustc_host; -use support::{basic_lib_manifest, path2url, project}; +use support::{basic_lib_manifest, project}; #[test] fn pathless_tools() { @@ -23,11 +23,10 @@ fn pathless_tools() { foo.cargo("build --verbose") .with_stderr(&format!( "\ -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc [..] -C ar=nonexistent-ar -C linker=nonexistent-linker [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = foo.url() )).run(); } @@ -65,11 +64,10 @@ fn absolute_tools() { foo.cargo("build --verbose").with_stderr(&format!( "\ -[COMPILING] foo v0.5.0 ({url}) +[COMPILING] foo v0.5.0 (CWD) [RUNNING] `rustc [..] -C ar={root}bogus/nonexistent-ar -C linker={root}bogus/nonexistent-linker [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = foo.url(), root = root, )).run(); } @@ -105,17 +103,14 @@ fn relative_tools() { ), ).build(); - let foo_path = p.root().join("bar"); - let foo_url = path2url(&foo_path); let prefix = p.root().into_os_string().into_string().unwrap(); - p.cargo("build --verbose").cwd(foo_path).with_stderr(&format!( + p.cargo("build --verbose").cwd(p.root().join("bar")).with_stderr(&format!( "\ -[COMPILING] bar v0.5.0 ({url}) +[COMPILING] bar v0.5.0 (CWD) [RUNNING] `rustc [..] -C ar={prefix}/./nonexistent-ar -C linker={prefix}/./tools/nonexistent-linker [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", - url = foo_url, prefix = prefix, )).run(); } @@ -143,35 +138,32 @@ fn custom_runner() { .with_status(101) .with_stderr_contains(&format!( "\ -[COMPILING] foo v0.0.1 ({url}) +[COMPILING] foo v0.0.1 (CWD) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `nonexistent-runner -r target/debug/foo[EXE] --param` ", - url = p.url() )).run(); p.cargo("test --test test --verbose -- --param") .with_status(101) .with_stderr_contains(&format!( "\ -[COMPILING] foo v0.0.1 ({url}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] [RUNNING] `nonexistent-runner -r [..]/target/debug/deps/test-[..][EXE] --param` ", - url = p.url() )).run(); p.cargo("bench --bench bench --verbose -- --param") .with_status(101) .with_stderr_contains(&format!( "\ -[COMPILING] foo v0.0.1 ({url}) +[COMPILING] foo v0.0.1 (CWD) [RUNNING] `rustc [..]` [RUNNING] `rustc [..]` [FINISHED] release [optimized] target(s) in [..] [RUNNING] `nonexistent-runner -r [..]/target/release/deps/bench-[..][EXE] --param --bench` ", - url = p.url() )).run(); } diff --git a/tests/testsuite/workspaces.rs b/tests/testsuite/workspaces.rs index 2ae838d047e..17c28009ffd 100644 --- a/tests/testsuite/workspaces.rs +++ b/tests/testsuite/workspaces.rs @@ -722,7 +722,7 @@ fn virtual_misconfigure() { .with_stderr( "\ error: current package believes it's in a workspace when it's not: -current: [..]bar[..]Cargo.toml +current: CWD/Cargo.toml workspace: [..]Cargo.toml this may be fixable by adding `bar` to the `workspace.members` array of the \