Skip to content

Commit be9d669

Browse files
committed
Added test case.
1 parent 1733f5e commit be9d669

File tree

3 files changed

+43
-8
lines changed

3 files changed

+43
-8
lines changed

src/bootstrap/builder.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,4 +1405,39 @@ mod __test {
14051405
},
14061406
]);
14071407
}
1408+
1409+
#[test]
1410+
fn test_with_no_doc_stage0() {
1411+
let mut config = configure(&[], &[]);
1412+
config.stage = Some(0);
1413+
config.cmd = Subcommand::Test {
1414+
paths: vec!["src/libstd".into()],
1415+
test_args: vec![],
1416+
rustc_args: vec![],
1417+
fail_fast: true,
1418+
doc_tests: DocTestsOption::No,
1419+
};
1420+
1421+
let build = Build::new(config);
1422+
let mut builder = Builder::new(&build);
1423+
1424+
let host = INTERNER.intern_str("A");
1425+
1426+
builder.run_step_descriptions(
1427+
&[StepDescription::from::<test::Crate>()],
1428+
&["src/libstd".into()],
1429+
);
1430+
1431+
// Ensure we don't build any compiler artifacts.
1432+
assert!(builder.cache.all::<compile::Rustc>().is_empty());
1433+
assert_eq!(first(builder.cache.all::<test::Crate>()), &[
1434+
test::Crate {
1435+
compiler: Compiler { host, stage: 0 },
1436+
target: host,
1437+
mode: Mode::Libstd,
1438+
test_kind: test::TestKind::Test,
1439+
krate: INTERNER.intern_str("std"),
1440+
},
1441+
]);
1442+
}
14081443
}

src/bootstrap/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl Crate {
304304
///
305305
/// These entries currently correspond to the various output directories of the
306306
/// build system, with each mod generating output in a different directory.
307-
#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq)]
307+
#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
308308
pub enum Mode {
309309
/// Build the standard library, placing output in the "stageN-std" directory.
310310
Libstd,

src/bootstrap/test.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use toolstate::ToolState;
3838
const ADB_TEST_DIR: &str = "/data/tmp/work";
3939

4040
/// The two modes of the test runner; tests or benchmarks.
41-
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone)]
41+
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, PartialOrd, Ord)]
4242
pub enum TestKind {
4343
/// Run `cargo test`
4444
Test,
@@ -1407,13 +1407,13 @@ impl Step for CrateNotDefault {
14071407
}
14081408

14091409

1410-
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1410+
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
14111411
pub struct Crate {
1412-
compiler: Compiler,
1413-
target: Interned<String>,
1414-
mode: Mode,
1415-
test_kind: TestKind,
1416-
krate: Interned<String>,
1412+
pub compiler: Compiler,
1413+
pub target: Interned<String>,
1414+
pub mode: Mode,
1415+
pub test_kind: TestKind,
1416+
pub krate: Interned<String>,
14171417
}
14181418

14191419
impl Step for Crate {

0 commit comments

Comments
 (0)