@@ -77,6 +77,10 @@ pub fn parse_config(args: Vec<String> ) -> Config {
77
77
optopt( "" , "target-rustcflags" , "flags to pass to rustc for target" , "FLAGS" ) ,
78
78
optflag( "" , "verbose" , "run tests verbosely, showing all output" ) ,
79
79
optopt( "" , "logfile" , "file to log test execution to" , "FILE" ) ,
80
+ optopt( "" , "save-metrics" , "file to save metrics to" , "FILE" ) ,
81
+ optopt( "" , "ratchet-metrics" , "file to ratchet metrics against" , "FILE" ) ,
82
+ optopt( "" , "ratchet-noise-percent" ,
83
+ "percent change in metrics to consider noise" , "N" ) ,
80
84
optflag( "" , "jit" , "run tests under the JIT" ) ,
81
85
optopt( "" , "target" , "the target to build for" , "TARGET" ) ,
82
86
optopt( "" , "host" , "the host to build for" , "HOST" ) ,
@@ -86,6 +90,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
86
90
optopt( "" , "adb-path" , "path to the android debugger" , "PATH" ) ,
87
91
optopt( "" , "adb-test-dir" , "path to tests for the android debugger" , "PATH" ) ,
88
92
optopt( "" , "lldb-python-dir" , "directory containing LLDB's python module" , "PATH" ) ,
93
+ optopt( "" , "test-shard" , "run shard A, of B shards, worth of the testsuite" , "A.B" ) ,
89
94
optflag( "h" , "help" , "show this message" ) ) ;
90
95
91
96
assert ! ( !args. is_empty( ) ) ;
@@ -147,6 +152,12 @@ pub fn parse_config(args: Vec<String> ) -> Config {
147
152
filter : filter,
148
153
cfail_regex : Regex :: new ( errors:: EXPECTED_PATTERN ) . unwrap ( ) ,
149
154
logfile : matches. opt_str ( "logfile" ) . map ( |s| Path :: new ( s) ) ,
155
+ save_metrics : matches. opt_str ( "save-metrics" ) . map ( |s| Path :: new ( s) ) ,
156
+ ratchet_metrics :
157
+ matches. opt_str ( "ratchet-metrics" ) . map ( |s| Path :: new ( s) ) ,
158
+ ratchet_noise_percent :
159
+ matches. opt_str ( "ratchet-noise-percent" )
160
+ . and_then ( |s| s. as_slice ( ) . parse :: < f64 > ( ) ) ,
150
161
runtool : matches. opt_str ( "runtool" ) ,
151
162
host_rustcflags : matches. opt_str ( "host-rustcflags" ) ,
152
163
target_rustcflags : matches. opt_str ( "target-rustcflags" ) ,
@@ -165,6 +176,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
165
176
opt_str2 ( matches. opt_str ( "adb-test-dir" ) ) . as_slice ( ) &&
166
177
!opt_str2 ( matches. opt_str ( "adb-test-dir" ) ) . is_empty ( ) ,
167
178
lldb_python_dir : matches. opt_str ( "lldb-python-dir" ) ,
179
+ test_shard : test:: opt_shard ( matches. opt_str ( "test-shard" ) ) ,
168
180
verbose : matches. opt_present ( "verbose" ) ,
169
181
}
170
182
}
@@ -198,6 +210,10 @@ pub fn log_config(config: &Config) {
198
210
logv ( c, format ! ( "adb_test_dir: {:?}" , config. adb_test_dir) ) ;
199
211
logv ( c, format ! ( "adb_device_status: {}" ,
200
212
config. adb_device_status) ) ;
213
+ match config. test_shard {
214
+ None => logv ( c, "test_shard: (all)" . to_string ( ) ) ,
215
+ Some ( ( a, b) ) => logv ( c, format ! ( "test_shard: {}.{}" , a, b) )
216
+ }
201
217
logv ( c, format ! ( "verbose: {}" , config. verbose) ) ;
202
218
logv ( c, format ! ( "\n " ) ) ;
203
219
}
@@ -268,8 +284,15 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
268
284
logfile : config. logfile . clone ( ) ,
269
285
run_tests : true ,
270
286
run_benchmarks : true ,
287
+ ratchet_metrics : config. ratchet_metrics . clone ( ) ,
288
+ ratchet_noise_percent : config. ratchet_noise_percent . clone ( ) ,
289
+ save_metrics : config. save_metrics . clone ( ) ,
290
+ test_shard : config. test_shard . clone ( ) ,
271
291
nocapture : false ,
272
292
color : test:: AutoColor ,
293
+ show_boxplot : false ,
294
+ boxplot_width : 50 ,
295
+ show_all_stats : false ,
273
296
}
274
297
}
275
298
0 commit comments