Skip to content

Commit

Permalink
add coverage for target specific value
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <[email protected]>
  • Loading branch information
onur-ozkan committed Jan 10, 2025
1 parent 4fd82f7 commit e02957a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/bootstrap/src/core/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,15 @@ fn override_toml() {
"--set=change-id=1".to_owned(),
"--set=rust.lto=fat".to_owned(),
"--set=rust.deny-warnings=false".to_owned(),
"--set=build.optimized-compiler-builtins=true".to_owned(),
"--set=build.gdb=\"bar\"".to_owned(),
"--set=build.tools=[\"cargo\"]".to_owned(),
"--set=llvm.build-config={\"foo\" = \"bar\"}".to_owned(),
"--set=target.x86_64-unknown-linux-gnu.runner=bar".to_owned(),
"--set=target.x86_64-unknown-linux-gnu.rpath=false".to_owned(),
"--set=target.aarch64-unknown-linux-gnu.sanitizers=false".to_owned(),
"--set=target.aarch64-apple-darwin.runner=apple".to_owned(),
"--set=target.aarch64-apple-darwin.optimized-compiler-builtins=false".to_owned(),
]),
|&_| {
toml::from_str(
Expand Down Expand Up @@ -167,6 +169,7 @@ runner = "x86_64-runner"
);
assert_eq!(config.gdb, Some("bar".into()), "setting string value with quotes");
assert!(!config.deny_warnings, "setting boolean value");
assert!(config.optimized_compiler_builtins, "setting boolean value");
assert_eq!(
config.tools,
Some(["cargo".to_string()].into_iter().collect()),
Expand All @@ -193,7 +196,11 @@ runner = "x86_64-runner"
..Default::default()
};
let darwin = TargetSelection::from_user("aarch64-apple-darwin");
let darwin_values = Target { runner: Some("apple".into()), ..Default::default() };
let darwin_values = Target {
runner: Some("apple".into()),
optimized_compiler_builtins: Some(false),
..Default::default()
};
assert_eq!(
config.target_config,
[(x86_64, x86_64_values), (aarch64, aarch64_values), (darwin, darwin_values)]
Expand Down

0 comments on commit e02957a

Please sign in to comment.