Skip to content

Commit 4b3ef41

Browse files
committed
bootstrap: update test modules
Signed-off-by: onur-ozkan <[email protected]>
1 parent ba574a6 commit 4b3ef41

File tree

11 files changed

+6
-14
lines changed

11 files changed

+6
-14
lines changed

src/bootstrap/src/core/build_steps/setup.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use std::str::FromStr;
1414
use std::{fmt, fs, io};
1515

1616
#[cfg(test)]
17-
#[path = "../../tests/setup.rs"]
1817
mod tests;
1918

2019
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]

src/bootstrap/src/core/builder.rs

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use clap::ValueEnum;
3232
use once_cell::sync::Lazy;
3333

3434
#[cfg(test)]
35-
#[path = "../tests/builder.rs"]
3635
mod tests;
3736

3837
pub struct Builder<'a> {

src/bootstrap/src/core/config/config.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
//! This module implements parsing `config.toml` configuration files to tweak
44
//! how the build runs.
55
6-
#[cfg(test)]
7-
#[path = "../../tests/config.rs"]
8-
mod tests;
9-
106
use std::cell::{Cell, RefCell};
117
use std::cmp;
128
use std::collections::{HashMap, HashSet};
@@ -1203,7 +1199,7 @@ impl Config {
12031199
Self::parse_inner(args, get_toml)
12041200
}
12051201

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

src/bootstrap/src/core/config/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
pub(crate) mod config;
22
pub(crate) mod flags;
3+
#[cfg(test)]
4+
mod tests;
35

46
pub use config::*;

src/bootstrap/src/tests/config.rs renamed to src/bootstrap/src/core/config/tests.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{Config, Flags};
1+
use super::{flags::Flags, Config};
22
use crate::core::config::{LldMode, TomlConfig};
33

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

216-
assert!(
217-
config
218-
.verify(&tempfile, "7e255dd9542648a8779268a0f268b891a198e9828e860ed23f826440e786eae5")
219-
);
216+
assert!(config
217+
.verify(&tempfile, "7e255dd9542648a8779268a0f268b891a198e9828e860ed23f826440e786eae5"));
220218

221219
remove_file(tempfile).unwrap();
222220
}

src/bootstrap/src/utils/change_tracker.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! the bootstrap.
44
55
#[cfg(test)]
6-
#[path = "../tests/change_tracker.rs"]
76
mod tests;
87

98
#[derive(Clone, Debug)]

src/bootstrap/src/utils/helpers.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use crate::LldMode;
2121
pub use crate::utils::dylib::{dylib_path, dylib_path_var};
2222

2323
#[cfg(test)]
24-
#[path = "../tests/helpers.rs"]
2524
mod tests;
2625

2726
/// A helper macro to `unwrap` a result except also print out details like:

0 commit comments

Comments
 (0)