Skip to content

Commit

Permalink
bootstrap: update test modules
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 Jan 21, 2024
1 parent ba574a6 commit 4b3ef41
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/bootstrap/src/core/build_steps/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::str::FromStr;
use std::{fmt, fs, io};

#[cfg(test)]
#[path = "../../tests/setup.rs"]
mod tests;

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use clap::ValueEnum;
use once_cell::sync::Lazy;

#[cfg(test)]
#[path = "../tests/builder.rs"]
mod tests;

pub struct Builder<'a> {
Expand Down
File renamed without changes.
6 changes: 1 addition & 5 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
//! This module implements parsing `config.toml` configuration files to tweak
//! how the build runs.

#[cfg(test)]
#[path = "../../tests/config.rs"]
mod tests;

use std::cell::{Cell, RefCell};
use std::cmp;
use std::collections::{HashMap, HashSet};
Expand Down Expand Up @@ -1203,7 +1199,7 @@ impl Config {
Self::parse_inner(args, get_toml)
}

fn parse_inner(args: &[String], get_toml: impl Fn(&Path) -> TomlConfig) -> Config {
pub(crate) fn parse_inner(args: &[String], get_toml: impl Fn(&Path) -> TomlConfig) -> Config {
let mut flags = Flags::parse(&args);
let mut config = Config::default_opts();

Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/src/core/config/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pub(crate) mod config;
pub(crate) mod flags;
#[cfg(test)]
mod tests;

pub use config::*;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{Config, Flags};
use super::{flags::Flags, Config};
use crate::core::config::{LldMode, TomlConfig};

use clap::CommandFactory;
Expand Down Expand Up @@ -213,10 +213,8 @@ fn verify_file_integrity() {
File::create(&tempfile).unwrap().write_all(b"dummy value").unwrap();
assert!(tempfile.exists());

assert!(
config
.verify(&tempfile, "7e255dd9542648a8779268a0f268b891a198e9828e860ed23f826440e786eae5")
);
assert!(config
.verify(&tempfile, "7e255dd9542648a8779268a0f268b891a198e9828e860ed23f826440e786eae5"));

remove_file(tempfile).unwrap();
}
Expand Down
1 change: 0 additions & 1 deletion src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//! the bootstrap.

#[cfg(test)]
#[path = "../tests/change_tracker.rs"]
mod tests;

#[derive(Clone, Debug)]
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion src/bootstrap/src/utils/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use crate::LldMode;
pub use crate::utils::dylib::{dylib_path, dylib_path_var};

#[cfg(test)]
#[path = "../tests/helpers.rs"]
mod tests;

/// A helper macro to `unwrap` a result except also print out details like:
Expand Down
File renamed without changes.

0 comments on commit 4b3ef41

Please sign in to comment.