Skip to content

Commit

Permalink
remove --config flags from unit test configs
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Aug 8, 2024
1 parent 9d21178 commit 4237e5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/bootstrap/src/core/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ use crate::core::build_steps::clippy::get_clippy_rules_in_order;
use crate::core::config::{LldMode, Target, TargetSelection, TomlConfig};

fn parse(config: &str) -> Config {
Config::parse_inner(&["check".to_string(), "--config=/does/not/exist".to_string()], |&_| {
toml::from_str(&config).unwrap()
})
Config::parse_inner(&["check".to_string()], |&_| toml::from_str(&config).unwrap())
}

#[test]
Expand Down Expand Up @@ -110,7 +108,6 @@ fn override_toml() {
let config = Config::parse_inner(
&[
"check".to_owned(),
"--config=/does/not/exist".to_owned(),
"--set=change-id=1".to_owned(),
"--set=rust.lto=fat".to_owned(),
"--set=rust.deny-warnings=false".to_owned(),
Expand Down Expand Up @@ -201,12 +198,7 @@ runner = "x86_64-runner"
#[should_panic]
fn override_toml_duplicate() {
Config::parse_inner(
&[
"check".to_owned(),
"--config=/does/not/exist".to_string(),
"--set=change-id=1".to_owned(),
"--set=change-id=2".to_owned(),
],
&["check".to_owned(), "--set=change-id=1".to_owned(), "--set=change-id=2".to_owned()],
|&_| toml::from_str("change-id = 0").unwrap(),
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/src/utils/helpers/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn test_check_cfg_arg() {

#[test]
fn test_program_out_of_date() {
let config = Config::parse(&["check".to_owned(), "--config=/does/not/exist".to_owned()]);
let config = Config::parse(&["check".to_owned()]);
let tempfile = config.tempdir().join(".tmp-stamp-file");
File::create(&tempfile).unwrap().write_all(b"dummy value").unwrap();
assert!(tempfile.exists());
Expand All @@ -73,7 +73,7 @@ fn test_program_out_of_date() {

#[test]
fn test_symlink_dir() {
let config = Config::parse(&["check".to_owned(), "--config=/does/not/exist".to_owned()]);
let config = Config::parse(&["check".to_owned()]);
let tempdir = config.tempdir().join(".tmp-dir");
let link_path = config.tempdir().join(".tmp-link");

Expand Down

0 comments on commit 4237e5d

Please sign in to comment.