@@ -19,6 +19,7 @@ struct Test {
1919 name : & ' static str ,
2020 sha : & ' static str ,
2121 lock : Option < & ' static str > ,
22+ packages : & ' static [ & ' static str ] ,
2223}
2324
2425const TEST_REPOS : & ' static [ Test ] = & [
@@ -27,30 +28,51 @@ const TEST_REPOS: &'static [Test] = &[
2728 repo : "https://github.com/iron/iron" ,
2829 sha : "21c7dae29c3c214c08533c2a55ac649b418f2fe3" ,
2930 lock : Some ( include_str ! ( "lockfiles/iron-Cargo.lock" ) ) ,
31+ packages : & [ ] ,
3032 } ,
3133 Test {
3234 name : "ripgrep" ,
3335 repo : "https://github.com/BurntSushi/ripgrep" ,
3436 sha : "b65bb37b14655e1a89c7cd19c8b011ef3e312791" ,
3537 lock : None ,
38+ packages : & [ ] ,
3639 } ,
3740 Test {
3841 name : "tokei" ,
3942 repo : "https://github.com/Aaronepower/tokei" ,
4043 sha : "5e11c4852fe4aa086b0e4fe5885822fbe57ba928" ,
4144 lock : None ,
45+ packages : & [ ] ,
4246 } ,
4347 Test {
4448 name : "treeify" ,
4549 repo : "https://github.com/dzamlo/treeify" ,
4650 sha : "999001b223152441198f117a68fb81f57bc086dd" ,
4751 lock : None ,
52+ packages : & [ ] ,
4853 } ,
4954 Test {
5055 name : "xsv" ,
5156 repo : "https://github.com/BurntSushi/xsv" ,
5257 sha : "4b308adbe48ac81657fd124b90b44f7c3263f771" ,
5358 lock : None ,
59+ packages : & [ ] ,
60+ } ,
61+ Test {
62+ name : "servo" ,
63+ repo : "https://github.com/servo/servo" ,
64+ sha : "38fe9533b93e985657f99a29772bf3d3c8694822" ,
65+ lock : None ,
66+ // Only test Stylo a.k.a. Quantum CSS, the parts of Servo going into Firefox.
67+ // This takes much less time to build than all of Servo and supports stable Rust.
68+ packages : & [ "stylo_tests" , "selectors" ] ,
69+ } ,
70+ Test {
71+ name : "webrender" ,
72+ repo : "https://github.com/servo/webrender" ,
73+ sha : "57250b2b8fa63934f80e5376a29f7dcb3f759ad6" ,
74+ lock : None ,
75+ packages : & [ ] ,
5476 } ,
5577] ;
5678
@@ -74,7 +96,7 @@ fn test_repo(cargo: &Path, out_dir: &Path, test: &Test) {
7496 . write_all ( lockfile. as_bytes ( ) )
7597 . expect ( "" ) ;
7698 }
77- if !run_cargo_test ( cargo, & dir) {
99+ if !run_cargo_test ( cargo, & dir, test . packages ) {
78100 panic ! ( "tests failed for {}" , test. repo) ;
79101 }
80102}
@@ -134,9 +156,13 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
134156 out_dir
135157}
136158
137- fn run_cargo_test ( cargo_path : & Path , crate_path : & Path ) -> bool {
138- let status = Command :: new ( cargo_path)
139- . arg ( "test" )
159+ fn run_cargo_test ( cargo_path : & Path , crate_path : & Path , packages : & [ & str ] ) -> bool {
160+ let mut command = Command :: new ( cargo_path) ;
161+ command. arg ( "test" ) ;
162+ for name in packages {
163+ command. arg ( "-p" ) . arg ( name) ;
164+ }
165+ let status = command
140166 // Disable rust-lang/cargo's cross-compile tests
141167 . env ( "CFG_DISABLE_CROSS_TESTS" , "1" )
142168 . current_dir ( crate_path)
0 commit comments