Skip to content

Commit e612cbd

Browse files
committed
add test for Build::cargo_out
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 0bdcd2c commit e612cbd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/bootstrap/src/core/builder/tests.rs

+21
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,27 @@ fn validate_path_remap() {
128128
});
129129
}
130130

131+
#[test]
132+
fn validate_cargo_output() {
133+
let build = Build::new(configure("test", &["A"], &["A"]));
134+
135+
let out = build.cargo_out(
136+
Compiler { host: TargetSelection::default(), stage: 1 },
137+
Mode::Rustc,
138+
TargetSelection::default(),
139+
);
140+
141+
assert!(out.ends_with("stage1-rustc/release"));
142+
143+
let out = build.cargo_out(
144+
Compiler { host: TargetSelection::default(), stage: 1 },
145+
Mode::Rustc,
146+
TargetSelection::from_user("B"),
147+
);
148+
149+
assert!(out.ends_with("stage1-rustc/B/release"));
150+
}
151+
131152
#[test]
132153
fn test_exclude() {
133154
let mut config = configure("test", &["A"], &["A"]);

0 commit comments

Comments
 (0)