Skip to content

Commit 5a8ac04

Browse files
committed
add coverage for Builder::is_host_target
Signed-off-by: onur-ozkan <[email protected]>
1 parent a9278c8 commit 5a8ac04

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

+16
Original file line numberDiff line numberDiff line change
@@ -861,3 +861,19 @@ fn test_test_coverage() {
861861
assert_eq!(modes, expected);
862862
}
863863
}
864+
865+
#[test]
866+
fn test_is_host_target() {
867+
let target1 = TargetSelection::from_user(TEST_TRIPLE_1);
868+
let target2 = TargetSelection::from_user(TEST_TRIPLE_2);
869+
870+
for (target1, target2) in [(target1, target2), (target2, target1)] {
871+
let mut config = configure("build", &[], &[]);
872+
config.build = target1;
873+
let build = Build::new(config);
874+
let builder = Builder::new(&build);
875+
876+
assert!(builder.is_host_target(&target1));
877+
assert!(!builder.is_host_target(&target2));
878+
}
879+
}

0 commit comments

Comments
 (0)