@@ -8,7 +8,12 @@ fn miri_path() -> PathBuf {
8
8
PathBuf :: from ( option_env ! ( "MIRI" ) . unwrap_or ( env ! ( "CARGO_BIN_EXE_miri" ) ) )
9
9
}
10
10
11
- fn run_tests ( mode : Mode , path : & str , target : Option < String > ) -> Result < ( ) > {
11
+ fn run_tests (
12
+ mode : Mode ,
13
+ path : & str ,
14
+ target : Option < String > ,
15
+ with_dependencies : bool ,
16
+ ) -> Result < ( ) > {
12
17
let in_rustc_test_suite = option_env ! ( "RUSTC_STAGE" ) . is_some ( ) ;
13
18
14
19
// Add some flags we always want.
@@ -68,7 +73,7 @@ fn run_tests(mode: Mode, path: &str, target: Option<String>) -> Result<()> {
68
73
path_filter : path_filter. collect ( ) ,
69
74
program : miri_path ( ) ,
70
75
output_conflict_handling,
71
- dependencies_crate_manifest_path : use_std
76
+ dependencies_crate_manifest_path : ( with_dependencies && use_std)
72
77
. then ( || Path :: new ( "test_dependencies" ) . join ( "Cargo.toml" ) ) ,
73
78
dependency_builder : Some ( DependencyBuilder {
74
79
program : std:: env:: var_os ( "CARGO" ) . unwrap ( ) . into ( ) ,
@@ -132,7 +137,14 @@ regexes! {
132
137
r"[^ ]*/\.?cargo/registry/.*/(.*\.rs)" => "CARGO_REGISTRY/.../$1" ,
133
138
}
134
139
135
- fn ui ( mode : Mode , path : & str ) -> Result < ( ) > {
140
+ enum Dependencies {
141
+ WithDependencies ,
142
+ WithoutDependencies ,
143
+ }
144
+
145
+ use Dependencies :: * ;
146
+
147
+ fn ui ( mode : Mode , path : & str , with_dependencies : Dependencies ) -> Result < ( ) > {
136
148
let target = get_target ( ) ;
137
149
138
150
let msg = format ! (
@@ -141,7 +153,11 @@ fn ui(mode: Mode, path: &str) -> Result<()> {
141
153
) ;
142
154
eprintln ! ( "{}" , msg. green( ) . bold( ) ) ;
143
155
144
- run_tests ( mode, path, target)
156
+ let with_dependencies = match with_dependencies {
157
+ WithDependencies => true ,
158
+ WithoutDependencies => false ,
159
+ } ;
160
+ run_tests ( mode, path, target, with_dependencies)
145
161
}
146
162
147
163
fn get_target ( ) -> Option < String > {
@@ -156,9 +172,10 @@ fn main() -> Result<()> {
156
172
// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
157
173
env:: set_var ( "MIRI_TEMP" , env:: temp_dir ( ) ) ;
158
174
159
- ui ( Mode :: Pass , "tests/pass" ) ?;
160
- ui ( Mode :: Panic , "tests/panic" ) ?;
161
- ui ( Mode :: Fail , "tests/fail" ) ?;
175
+ ui ( Mode :: Pass , "tests/pass" , WithoutDependencies ) ?;
176
+ ui ( Mode :: Pass , "tests/pass-dep" , WithDependencies ) ?;
177
+ ui ( Mode :: Panic , "tests/panic" , WithDependencies ) ?;
178
+ ui ( Mode :: Fail , "tests/fail" , WithDependencies ) ?;
162
179
163
180
Ok ( ( ) )
164
181
}
0 commit comments