Skip to content

Commit c68ab93

Browse files
committed
improve bootstrap tests structure
Signed-off-by: onur-ozkan <[email protected]>
1 parent acef1c2 commit c68ab93

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/bootstrap/builder/tests.rs renamed to src/bootstrap/src/tests/builder.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::*;
2-
use crate::config::{Config, DryRun, TargetSelection};
3-
use crate::doc::DocumentationFormat;
2+
use crate::core::config::{Config, DryRun, TargetSelection};
3+
use crate::core::build_steps::doc::DocumentationFormat;
44
use std::thread;
55

66
fn configure(cmd: &str, host: &[&str], target: &[&str]) -> Config {
@@ -158,7 +158,7 @@ fn alias_and_path_for_library() {
158158

159159
#[test]
160160
fn test_beta_rev_parsing() {
161-
use crate::extract_beta_rev;
161+
use crate::utils::helpers::extract_beta_rev;
162162

163163
// single digit revision
164164
assert_eq!(extract_beta_rev("1.99.9-beta.7 (xxxxxx)"), Some("7".to_string()));
@@ -174,7 +174,7 @@ fn test_beta_rev_parsing() {
174174

175175
mod defaults {
176176
use super::{configure, first, run_build};
177-
use crate::builder::*;
177+
use crate::core::builder::*;
178178
use crate::Config;
179179
use pretty_assertions::assert_eq;
180180

@@ -285,7 +285,7 @@ mod defaults {
285285

286286
mod dist {
287287
use super::{first, run_build, Config};
288-
use crate::builder::*;
288+
use crate::core::builder::*;
289289
use pretty_assertions::assert_eq;
290290

291291
fn configure(host: &[&str], target: &[&str]) -> Config {

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use crate::config::TomlConfig;
2-
1+
use crate::core::config::TomlConfig;
32
use super::{Config, Flags};
3+
44
use clap::CommandFactory;
55
use serde::Deserialize;
66
use std::{
@@ -18,7 +18,7 @@ fn parse(config: &str) -> Config {
1818

1919
#[test]
2020
fn download_ci_llvm() {
21-
if crate::llvm::is_ci_llvm_modified(&parse("")) {
21+
if crate::core::build_steps::llvm::is_ci_llvm_modified(&parse("")) {
2222
eprintln!("Detected LLVM as non-available: running in CI and modified LLVM in this change");
2323
return;
2424
}
@@ -137,7 +137,7 @@ build-config = {}
137137
assert_eq!(config.change_id, Some(1), "setting top-level value");
138138
assert_eq!(
139139
config.rust_lto,
140-
crate::config::RustcLto::Fat,
140+
crate::core::config::RustcLto::Fat,
141141
"setting string value without quotes"
142142
);
143143
assert_eq!(config.gdb, Some("bar".into()), "setting string value with quotes");
@@ -175,7 +175,7 @@ fn profile_user_dist() {
175175
"profile = \"user\"".to_owned()
176176
} else {
177177
assert!(file.ends_with("config.dist.toml"));
178-
std::fs::read_to_string(dbg!(file)).unwrap()
178+
std::fs::read_to_string(file).unwrap()
179179
};
180180
toml::from_str(&contents)
181181
.and_then(|table: toml::Value| TomlConfig::deserialize(table))
File renamed without changes.

0 commit comments

Comments
 (0)