@@ -300,16 +300,9 @@ pub struct TestOpts {
300
300
pub run_ignored : bool ,
301
301
pub run_tests : bool ,
302
302
pub run_benchmarks : bool ,
303
- pub ratchet_metrics : Option < Path > ,
304
- pub ratchet_noise_percent : Option < f64 > ,
305
- pub save_metrics : Option < Path > ,
306
- pub test_shard : Option < ( uint , uint ) > ,
307
303
pub logfile : Option < Path > ,
308
304
pub nocapture : bool ,
309
305
pub color : ColorConfig ,
310
- pub show_boxplot : bool ,
311
- pub boxplot_width : uint ,
312
- pub show_all_stats : bool ,
313
306
}
314
307
315
308
impl TestOpts {
@@ -320,16 +313,9 @@ impl TestOpts {
320
313
run_ignored : false ,
321
314
run_tests : false ,
322
315
run_benchmarks : false ,
323
- ratchet_metrics : None ,
324
- ratchet_noise_percent : None ,
325
- save_metrics : None ,
326
- test_shard : None ,
327
316
logfile : None ,
328
317
nocapture : false ,
329
318
color : AutoColor ,
330
- show_boxplot : false ,
331
- boxplot_width : 50 ,
332
- show_all_stats : false ,
333
319
}
334
320
}
335
321
}
@@ -342,28 +328,14 @@ fn optgroups() -> Vec<getopts::OptGroup> {
342
328
getopts:: optflag( "" , "test" , "Run tests and not benchmarks" ) ,
343
329
getopts:: optflag( "" , "bench" , "Run benchmarks instead of tests" ) ,
344
330
getopts:: optflag( "h" , "help" , "Display this message (longer with --help)" ) ,
345
- getopts:: optopt( "" , "save-metrics" , "Location to save bench metrics" ,
346
- "PATH" ) ,
347
- getopts:: optopt( "" , "ratchet-metrics" ,
348
- "Location to load and save metrics from. The metrics \
349
- loaded are cause benchmarks to fail if they run too \
350
- slowly", "PATH" ) ,
351
- getopts:: optopt( "" , "ratchet-noise-percent" ,
352
- "Tests within N% of the recorded metrics will be \
353
- considered as passing", "PERCENTAGE" ) ,
354
331
getopts:: optopt( "" , "logfile" , "Write logs to the specified file instead \
355
332
of stdout", "PATH" ) ,
356
- getopts:: optopt( "" , "test-shard" , "run shard A, of B shards, worth of the testsuite" ,
357
- "A.B" ) ,
358
333
getopts:: optflag( "" , "nocapture" , "don't capture stdout/stderr of each \
359
334
task, allow printing directly") ,
360
335
getopts:: optopt( "" , "color" , "Configure coloring of output:
361
336
auto = colorize if stdout is a tty and tests are run on serially (default);
362
337
always = always colorize output;
363
- never = never colorize output;" , "auto|always|never" ) ,
364
- getopts:: optflag( "" , "boxplot" , "Display a boxplot of the benchmark statistics" ) ,
365
- getopts:: optopt( "" , "boxplot-width" , "Set the boxplot width (default 50)" , "WIDTH" ) ,
366
- getopts:: optflag( "" , "stats" , "Display the benchmark min, max, and quartiles" ) )
338
+ never = never colorize output;" , "auto|always|never" ) )
367
339
}
368
340
369
341
fn usage ( binary : & str ) {
@@ -428,19 +400,6 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
428
400
let run_tests = ! run_benchmarks ||
429
401
matches. opt_present ( "test" ) ;
430
402
431
- let ratchet_metrics = matches. opt_str ( "ratchet-metrics" ) ;
432
- let ratchet_metrics = ratchet_metrics. map ( |s| Path :: new ( s) ) ;
433
-
434
- let ratchet_noise_percent = matches. opt_str ( "ratchet-noise-percent" ) ;
435
- let ratchet_noise_percent =
436
- ratchet_noise_percent. map ( |s| s. as_slice ( ) . parse :: < f64 > ( ) . unwrap ( ) ) ;
437
-
438
- let save_metrics = matches. opt_str ( "save-metrics" ) ;
439
- let save_metrics = save_metrics. map ( |s| Path :: new ( s) ) ;
440
-
441
- let test_shard = matches. opt_str ( "test-shard" ) ;
442
- let test_shard = opt_shard ( test_shard) ;
443
-
444
403
let mut nocapture = matches. opt_present ( "nocapture" ) ;
445
404
if !nocapture {
446
405
nocapture = os:: getenv ( "RUST_TEST_NOCAPTURE" ) . is_some ( ) ;
@@ -456,63 +415,19 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
456
415
v) ) ) ,
457
416
} ;
458
417
459
- let show_boxplot = matches. opt_present ( "boxplot" ) ;
460
- let boxplot_width = match matches. opt_str ( "boxplot-width" ) {
461
- Some ( width) => {
462
- match FromStr :: from_str ( width. as_slice ( ) ) {
463
- Some ( width) => width,
464
- None => {
465
- return Some ( Err ( format ! ( "argument for --boxplot-width must be a uint" ) ) ) ;
466
- }
467
- }
468
- }
469
- None => 50 ,
470
- } ;
471
-
472
- let show_all_stats = matches. opt_present ( "stats" ) ;
473
-
474
418
let test_opts = TestOpts {
475
419
filter : filter,
476
420
run_ignored : run_ignored,
477
421
run_tests : run_tests,
478
422
run_benchmarks : run_benchmarks,
479
- ratchet_metrics : ratchet_metrics,
480
- ratchet_noise_percent : ratchet_noise_percent,
481
- save_metrics : save_metrics,
482
- test_shard : test_shard,
483
423
logfile : logfile,
484
424
nocapture : nocapture,
485
425
color : color,
486
- show_boxplot : show_boxplot,
487
- boxplot_width : boxplot_width,
488
- show_all_stats : show_all_stats,
489
426
} ;
490
427
491
428
Some ( Ok ( test_opts) )
492
429
}
493
430
494
- pub fn opt_shard ( maybestr : Option < String > ) -> Option < ( uint , uint ) > {
495
- match maybestr {
496
- None => None ,
497
- Some ( s) => {
498
- let mut it = s. split ( '.' ) ;
499
- match ( it. next ( ) . and_then ( |s| s. parse :: < uint > ( ) ) ,
500
- it. next ( ) . and_then ( |s| s. parse :: < uint > ( ) ) ,
501
- it. next ( ) ) {
502
- ( Some ( a) , Some ( b) , None ) => {
503
- if a <= 0 || a > b {
504
- panic ! ( "tried to run shard {a}.{b}, but {a} is out of bounds \
505
- (should be between 1 and {b}", a=a, b=b)
506
- }
507
- Some ( ( a, b) )
508
- }
509
- _ => None ,
510
- }
511
- }
512
- }
513
- }
514
-
515
-
516
431
#[ derive( Clone , PartialEq ) ]
517
432
pub struct BenchSamples {
518
433
ns_iter_summ : stats:: Summary < f64 > ,
@@ -568,9 +483,9 @@ impl<T: Writer> ConsoleTestState<T> {
568
483
out : out,
569
484
log_out : log_out,
570
485
use_color : use_color ( opts) ,
571
- show_boxplot : opts . show_boxplot ,
572
- boxplot_width : opts . boxplot_width ,
573
- show_all_stats : opts . show_all_stats ,
486
+ show_boxplot : false ,
487
+ boxplot_width : 50 ,
488
+ show_all_stats : false ,
574
489
total : 0 u,
575
490
passed : 0 u,
576
491
failed : 0 u,
@@ -913,15 +828,7 @@ pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn> ) -> io::IoR
913
828
None => { }
914
829
}
915
830
try!( run_tests ( opts, tests, |x| callback ( & x, & mut st) ) ) ;
916
- match opts. save_metrics {
917
- None => ( ) ,
918
- Some ( ref pth) => {
919
- try!( st. metrics . save ( pth) ) ;
920
- try!( st. write_plain ( format ! ( "\n metrics saved to: {:?}" ,
921
- pth. display( ) ) . as_slice ( ) ) ) ;
922
- }
923
- }
924
- return st. write_run_finish ( & opts. ratchet_metrics , opts. ratchet_noise_percent ) ;
831
+ return st. write_run_finish ( & None , None ) ;
925
832
}
926
833
927
834
#[ test]
@@ -1095,18 +1002,7 @@ pub fn filter_tests(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> Vec<TestDescA
1095
1002
// Sort the tests alphabetically
1096
1003
filtered. sort_by ( |t1, t2| t1. desc . name . as_slice ( ) . cmp ( t2. desc . name . as_slice ( ) ) ) ;
1097
1004
1098
- // Shard the remaining tests, if sharding requested.
1099
- match opts. test_shard {
1100
- None => filtered,
1101
- Some ( ( a, b) ) => {
1102
- filtered. into_iter ( ) . enumerate ( )
1103
- // note: using a - 1 so that the valid shards, for example, are
1104
- // 1.2 and 2.2 instead of 0.2 and 1.2
1105
- . filter ( |& ( i, _) | i % b == ( a - 1 ) )
1106
- . map ( |( _, t) | t)
1107
- . collect ( )
1108
- }
1109
- }
1005
+ filtered
1110
1006
}
1111
1007
1112
1008
pub fn run_test ( opts : & TestOpts ,
0 commit comments