@@ -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,35 @@ 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 : & [ ] ,
54
60
} ,
55
61
] ;
56
62
@@ -74,7 +80,7 @@ fn test_repo(cargo: &Path, out_dir: &Path, test: &Test) {
74
80
. write_all ( lockfile. as_bytes ( ) )
75
81
. expect ( "" ) ;
76
82
}
77
- if !run_cargo_test ( cargo, & dir) {
83
+ if !run_cargo_test ( cargo, & dir, test . packages ) {
78
84
panic ! ( "tests failed for {}" , test. repo) ;
79
85
}
80
86
}
@@ -134,9 +140,13 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
134
140
out_dir
135
141
}
136
142
137
- fn run_cargo_test ( cargo_path : & Path , crate_path : & Path ) -> bool {
138
- let status = Command :: new ( cargo_path)
139
- . arg ( "test" )
143
+ fn run_cargo_test ( cargo_path : & Path , crate_path : & Path , packages : & [ & str ] ) -> bool {
144
+ let mut command = Command :: new ( cargo_path) ;
145
+ command. arg ( "test" ) ;
146
+ for name in packages {
147
+ command. arg ( "-p" ) . arg ( name) ;
148
+ }
149
+ let status = command
140
150
// Disable rust-lang/cargo's cross-compile tests
141
151
. env ( "CFG_DISABLE_CROSS_TESTS" , "1" )
142
152
. current_dir ( crate_path)
0 commit comments