diff options
| author | bors <bors@rust-lang.org> | 2018-11-03 20:13:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-11-03 20:13:47 +0000 |
| commit | 04fdb44f5ccb6f909cf0f768781afa483e97097c (patch) | |
| tree | 43eba9bd21bb59d8fa9e6ccf86ea7b3c2ec12ddc | |
| parent | a3f0f5107e48d47936a604325a1af325033901d0 (diff) | |
| parent | 2bde4e7c057d7ebfd5902ef4e2d4c9f460d99b17 (diff) | |
| download | rust-04fdb44f5ccb6f909cf0f768781afa483e97097c.tar.gz rust-04fdb44f5ccb6f909cf0f768781afa483e97097c.zip | |
Auto merge of #55661 - kennytm:fix-exclude, r=alexcrichton
Fixed the bug in bootstrap where --exclude was ignored for run-pass test This should fix the 3 hour timeout on AppVeyor which happened a lot recently. Additionally, further rebalanced the AppVeyor subsets by moving "ui" and "linkchecker" into Set 2.
| -rw-r--r-- | src/bootstrap/builder.rs | 34 | ||||
| -rw-r--r-- | src/bootstrap/cache.rs | 5 | ||||
| -rw-r--r-- | src/bootstrap/mk/Makefile.in | 7 |
3 files changed, 43 insertions, 3 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index c7121cb0369..900f336ef8c 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -130,7 +130,7 @@ impl PathSet { fn has(&self, needle: &Path) -> bool { match self { PathSet::Set(set) => set.iter().any(|p| p.ends_with(needle)), - PathSet::Suite(_) => false, + PathSet::Suite(suite) => suite.ends_with(needle), } } @@ -1849,7 +1849,7 @@ mod __test { ); // Ensure we don't build any compiler artifacts. - assert!(builder.cache.all::<compile::Rustc>().is_empty()); + assert!(!builder.cache.contains::<compile::Rustc>()); assert_eq!( first(builder.cache.all::<test::Crate>()), &[test::Crate { @@ -1861,4 +1861,34 @@ mod __test { },] ); } + + #[test] + fn test_exclude() { + let mut config = configure(&[], &[]); + config.exclude = vec![ + "src/test/run-pass".into(), + "src/tools/tidy".into(), + ]; + config.cmd = Subcommand::Test { + paths: Vec::new(), + test_args: Vec::new(), + rustc_args: Vec::new(), + fail_fast: true, + doc_tests: DocTests::No, + bless: false, + compare_mode: None, + }; + + let build = Build::new(config); + let builder = Builder::new(&build); + builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Test), &[]); + + // Ensure we have really excluded run-pass & tidy + assert!(!builder.cache.contains::<test::RunPass>()); + assert!(!builder.cache.contains::<test::Tidy>()); + + // Ensure other tests are not affected. + assert!(builder.cache.contains::<test::RunPassFullDeps>()); + assert!(builder.cache.contains::<test::RustdocUi>()); + } } diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs index fd9a1be2072..0b561a3523f 100644 --- a/src/bootstrap/cache.rs +++ b/src/bootstrap/cache.rs @@ -286,4 +286,9 @@ impl Cache { v.sort_by_key(|&(a, _)| a); v } + + #[cfg(test)] + pub fn contains<S: Step>(&self) -> bool { + self.0.borrow().contains_key(&TypeId::of::<S>()) + } } diff --git a/src/bootstrap/mk/Makefile.in b/src/bootstrap/mk/Makefile.in index bcf2f6a675e..862fbbf1f28 100644 --- a/src/bootstrap/mk/Makefile.in +++ b/src/bootstrap/mk/Makefile.in @@ -85,7 +85,12 @@ check-stage2-T-arm-linux-androideabi-H-x86_64-unknown-linux-gnu: check-stage2-T-x86_64-unknown-linux-musl-H-x86_64-unknown-linux-gnu: $(Q)$(BOOTSTRAP) test --target x86_64-unknown-linux-musl -TESTS_IN_2 := src/test/run-pass src/test/compile-fail src/test/run-pass-fulldeps +TESTS_IN_2 := \ + src/test/ui \ + src/test/run-pass \ + src/test/compile-fail \ + src/test/run-pass-fulldeps \ + src/tools/linkchecker appveyor-subset-1: $(Q)$(BOOTSTRAP) test $(TESTS_IN_2:%=--exclude %) |
