mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
test(build-dir): Added build_directory
field to cargo metadata output
This commit is contained in:
parent
2a5f670ec0
commit
155aaae22e
@ -4294,6 +4294,43 @@ fn dep_kinds_workspace() {
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn build_dir() {
|
||||
let p = project()
|
||||
.file("src/main.rs", r#"fn main() { println!("Hello, World!") }"#)
|
||||
.file(
|
||||
".cargo/config.toml",
|
||||
r#"
|
||||
[build]
|
||||
build-dir = "build-dir"
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
|
||||
p.cargo("metadata -Z build-dir")
|
||||
.masquerade_as_nightly_cargo(&["build-dir"])
|
||||
.with_stdout_data(
|
||||
str![[r#"
|
||||
{
|
||||
"metadata": null,
|
||||
"packages": "{...}",
|
||||
"resolve": "{...}",
|
||||
"target_directory": "[ROOT]/foo/target",
|
||||
"version": 1,
|
||||
"workspace_default_members": [
|
||||
"path+[ROOTURL]/foo#0.0.1"
|
||||
],
|
||||
"workspace_members": [
|
||||
"path+[ROOTURL]/foo#0.0.1"
|
||||
],
|
||||
"workspace_root": "[ROOT]/foo"
|
||||
}
|
||||
"#]]
|
||||
.is_json(),
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
// Creating non-utf8 path is an OS-specific pain, so let's run this only on
|
||||
// linux, where arbitrary bytes work.
|
||||
#[cfg(target_os = "linux")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user