]> git.lizzy.rs Git - rust.git/commitdiff
Added test case.
authorkennytm <kennytm@gmail.com>
Sat, 5 May 2018 18:33:01 +0000 (02:33 +0800)
committerkennytm <kennytm@gmail.com>
Sat, 5 May 2018 18:34:07 +0000 (02:34 +0800)
src/bootstrap/builder.rs
src/bootstrap/lib.rs
src/bootstrap/test.rs

index 408e61ef548691dd4523f4babc7d52b5d0f320ea..da12fbdb942e46d6cd287a98bbd8c9634ef525ee 100644 (file)
@@ -1405,4 +1405,39 @@ fn build_with_target_flag() {
             },
         ]);
     }
+
+    #[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"),
+            },
+        ]);
+    }
 }
index 624319485be059b9894a14c61fab695f2a36653e..ff9a262e2cc76df588046eea7415fe730547ee82 100644 (file)
@@ -304,7 +304,7 @@ fn local_path(&self, build: &Build) -> PathBuf {
 ///
 /// 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,
index 0d430c300368e2eb4da2b9f4b2b0872a0eb40684..2f0e3868f89aef8af987b4cf12eb9006a8fcfacb 100644 (file)
@@ -38,7 +38,7 @@
 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 @@ fn run(self, builder: &Builder) {
 }
 
 
-#[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 {