about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorXimin Luo <infinity0@pwned.gg>2017-06-15 13:24:08 +0200
committerXimin Luo <infinity0@pwned.gg>2017-06-15 13:24:08 +0200
commit62c245281c9e988cf5eb7cffa15f0dd2ce3b54cf (patch)
tree6fcbae9810a2f12dec6f40d147f95ed3aea9cdbc /src/bootstrap
parente40ef964fe491b19c22dfb8dd36d1eab14223c36 (diff)
downloadrust-62c245281c9e988cf5eb7cffa15f0dd2ce3b54cf.tar.gz
rust-62c245281c9e988cf5eb7cffa15f0dd2ce3b54cf.zip
Ensure that disable-doc builds don't depend on doc targets
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/step.rs27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs
index 9e8b08a23b7..ca829cc5668 100644
--- a/src/bootstrap/step.rs
+++ b/src/bootstrap/step.rs
@@ -1407,13 +1407,20 @@ mod tests {
     fn build(args: &[&str],
              extra_host: &[&str],
              extra_target: &[&str]) -> Build {
+        build_(args, extra_host, extra_target, true)
+    }
+
+    fn build_(args: &[&str],
+              extra_host: &[&str],
+              extra_target: &[&str],
+              docs: bool) -> Build {
         let mut args = args.iter().map(|s| s.to_string()).collect::<Vec<_>>();
         args.push("--build".to_string());
         args.push("A".to_string());
         let flags = Flags::parse(&args);
 
         let mut config = Config::default();
-        config.docs = true;
+        config.docs = docs;
         config.build = "A".to_string();
         config.host = vec![config.build.clone()];
         config.host.extend(extra_host.iter().map(|s| s.to_string()));
@@ -1768,4 +1775,22 @@ mod tests {
         assert!(!plan.iter().any(|s| s.name.contains("tidy")));
         assert!(plan.iter().any(|s| s.name.contains("valgrind")));
     }
+
+    #[test]
+    fn test_disable_docs() {
+        let build = build_(&["test"], &[], &[], false);
+        let rules = super::build_rules(&build);
+        let plan = rules.plan();
+        println!("rules: {:#?}", plan);
+        assert!(!plan.iter().any(|s| {
+            s.name.contains("doc-") || s.name.contains("default:doc")
+        }));
+        // none of the dependencies should be a doc rule either
+        assert!(!plan.iter().any(|s| {
+            rules.rules[s.name].deps.iter().any(|dep| {
+                let dep = dep(&rules.sbuild.name(s.name));
+                dep.name.contains("doc-") || dep.name.contains("default:doc")
+            })
+        }));
+    }
 }