Skip to content

Commit 222e43d

Browse files
committed
improve bootstrap tests structure
Signed-off-by: onur-ozkan <[email protected]>
1 parent 52ec2e5 commit 222e43d

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 {
@@ -159,7 +159,7 @@ fn alias_and_path_for_library() {
159159

160160
#[test]
161161
fn test_beta_rev_parsing() {
162-
use crate::extract_beta_rev;
162+
use crate::utils::helpers::extract_beta_rev;
163163

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

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

@@ -286,7 +286,7 @@ mod defaults {
286286

287287
mod dist {
288288
use super::{first, run_build, Config};
289-
use crate::builder::*;
289+
use crate::core::builder::*;
290290
use pretty_assertions::assert_eq;
291291

292292
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::{env, path::Path};
@@ -13,7 +13,7 @@ fn parse(config: &str) -> Config {
1313

1414
#[test]
1515
fn download_ci_llvm() {
16-
if crate::llvm::is_ci_llvm_modified(&parse("")) {
16+
if crate::core::build_steps::llvm::is_ci_llvm_modified(&parse("")) {
1717
eprintln!("Detected LLVM as non-available: running in CI and modified LLVM in this change");
1818
return;
1919
}
@@ -132,7 +132,7 @@ build-config = {}
132132
assert_eq!(config.change_id, Some(1), "setting top-level value");
133133
assert_eq!(
134134
config.rust_lto,
135-
crate::config::RustcLto::Fat,
135+
crate::core::config::RustcLto::Fat,
136136
"setting string value without quotes"
137137
);
138138
assert_eq!(config.gdb, Some("bar".into()), "setting string value with quotes");
@@ -170,7 +170,7 @@ fn profile_user_dist() {
170170
"profile = \"user\"".to_owned()
171171
} else {
172172
assert!(file.ends_with("config.dist.toml"));
173-
std::fs::read_to_string(dbg!(file)).unwrap()
173+
std::fs::read_to_string(file).unwrap()
174174
};
175175
toml::from_str(&contents)
176176
.and_then(|table: toml::Value| TomlConfig::deserialize(table))
File renamed without changes.

0 commit comments

Comments
 (0)