@@ -19,6 +19,7 @@ struct Test {
19
19
name : & ' static str ,
20
20
sha : & ' static str ,
21
21
lock : Option < & ' static str > ,
22
+ packages : & ' static [ & ' static str ] ,
22
23
}
23
24
24
25
const TEST_REPOS : & ' static [ Test ] = & [
@@ -27,30 +28,51 @@ const TEST_REPOS: &'static [Test] = &[
27
28
repo : "https://github.com/iron/iron" ,
28
29
sha : "21c7dae29c3c214c08533c2a55ac649b418f2fe3" ,
29
30
lock : Some ( include_str ! ( "lockfiles/iron-Cargo.lock" ) ) ,
31
+ packages : & [ ] ,
30
32
} ,
31
33
Test {
32
34
name : "ripgrep" ,
33
35
repo : "https://github.com/BurntSushi/ripgrep" ,
34
36
sha : "b65bb37b14655e1a89c7cd19c8b011ef3e312791" ,
35
37
lock : None ,
38
+ packages : & [ ] ,
36
39
} ,
37
40
Test {
38
41
name : "tokei" ,
39
42
repo : "https://github.com/Aaronepower/tokei" ,
40
43
sha : "5e11c4852fe4aa086b0e4fe5885822fbe57ba928" ,
41
44
lock : None ,
45
+ packages : & [ ] ,
42
46
} ,
43
47
Test {
44
48
name : "treeify" ,
45
49
repo : "https://github.com/dzamlo/treeify" ,
46
50
sha : "999001b223152441198f117a68fb81f57bc086dd" ,
47
51
lock : None ,
52
+ packages : & [ ] ,
48
53
} ,
49
54
Test {
50
55
name : "xsv" ,
51
56
repo : "https://github.com/BurntSushi/xsv" ,
52
57
sha : "4b308adbe48ac81657fd124b90b44f7c3263f771" ,
53
58
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 : & [ ] ,
54
76
} ,
55
77
] ;
56
78
@@ -74,7 +96,7 @@ fn test_repo(cargo: &Path, out_dir: &Path, test: &Test) {
74
96
. write_all ( lockfile. as_bytes ( ) )
75
97
. expect ( "" ) ;
76
98
}
77
- if !run_cargo_test ( cargo, & dir) {
99
+ if !run_cargo_test ( cargo, & dir, test . packages ) {
78
100
panic ! ( "tests failed for {}" , test. repo) ;
79
101
}
80
102
}
@@ -134,9 +156,13 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
134
156
out_dir
135
157
}
136
158
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
140
166
// Disable rust-lang/cargo's cross-compile tests
141
167
. env ( "CFG_DISABLE_CROSS_TESTS" , "1" )
142
168
. current_dir ( crate_path)
0 commit comments