about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-05-06 02:33:01 +0800
committerkennytm <kennytm@gmail.com>2018-05-06 02:34:07 +0800
commitbe9d6690b22c7bdf46dda7f83ca61b69f58ce78b (patch)
tree5f2454c782e20268829bd172eac5c2e3ded8690d
parent1733f5e1c0a69c853adebf718fc7b4f81a1d257b (diff)
downloadrust-be9d6690b22c7bdf46dda7f83ca61b69f58ce78b.tar.gz
rust-be9d6690b22c7bdf46dda7f83ca61b69f58ce78b.zip
Added test case.
-rw-r--r--src/bootstrap/builder.rs35
-rw-r--r--src/bootstrap/lib.rs2
-rw-r--r--src/bootstrap/test.rs14
3 files changed, 43 insertions, 8 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 408e61ef548..da12fbdb942 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1405,4 +1405,39 @@ mod __test {
             },
         ]);
     }
+
+    #[test]
+    fn test_with_no_doc_stage0() {
+        let mut config = configure(&[], &[]);
+        config.stage = Some(0);
+        config.cmd = Subcommand::Test {
+            paths: vec!["src/libstd".into()],
+            test_args: vec![],
+            rustc_args: vec![],
+            fail_fast: true,
+            doc_tests: DocTestsOption::No,
+        };
+
+        let build = Build::new(config);
+        let mut builder = Builder::new(&build);
+
+        let host = INTERNER.intern_str("A");
+
+        builder.run_step_descriptions(
+            &[StepDescription::from::<test::Crate>()],
+            &["src/libstd".into()],
+        );
+
+        // Ensure we don't build any compiler artifacts.
+        assert!(builder.cache.all::<compile::Rustc>().is_empty());
+        assert_eq!(first(builder.cache.all::<test::Crate>()), &[
+            test::Crate {
+                compiler: Compiler { host, stage: 0 },
+                target: host,
+                mode: Mode::Libstd,
+                test_kind: test::TestKind::Test,
+                krate: INTERNER.intern_str("std"),
+            },
+        ]);
+    }
 }
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 624319485be..ff9a262e2cc 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -304,7 +304,7 @@ impl Crate {
 ///
 /// These entries currently correspond to the various output directories of the
 /// build system, with each mod generating output in a different directory.
-#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq)]
+#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
 pub enum Mode {
     /// Build the standard library, placing output in the "stageN-std" directory.
     Libstd,
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 0d430c30036..2f0e3868f89 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -38,7 +38,7 @@ use toolstate::ToolState;
 const ADB_TEST_DIR: &str = "/data/tmp/work";
 
 /// The two modes of the test runner; tests or benchmarks.
-#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone)]
+#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, PartialOrd, Ord)]
 pub enum TestKind {
     /// Run `cargo test`
     Test,
@@ -1407,13 +1407,13 @@ impl Step for CrateNotDefault {
 }
 
 
-#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 pub struct Crate {
-    compiler: Compiler,
-    target: Interned<String>,
-    mode: Mode,
-    test_kind: TestKind,
-    krate: Interned<String>,
+    pub compiler: Compiler,
+    pub target: Interned<String>,
+    pub mode: Mode,
+    pub test_kind: TestKind,
+    pub krate: Interned<String>,
 }
 
 impl Step for Crate {