Skip to content

Commit 32ac427

Browse files
committed
---
yaml --- r: 174769 b: refs/heads/snap-stage3 c: 4f6f7e5 h: refs/heads/master i: 174767: 80abcb5 v: v3
1 parent 271f91e commit 32ac427

File tree

3 files changed

+7
-118
lines changed

3 files changed

+7
-118
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: a0f86de49748b472d4d189d9688b0d856c000914
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: ec4178597271bfb6cb5e01af8d62b30f3c7793d6
4+
refs/heads/snap-stage3: 4f6f7e5d1dc791e77184641d3230a9b857b34e47
55
refs/heads/try: 08f6380a9f0b866796080094f44fe25ea5636547
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/compiletest/compiletest.rs

-7
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,8 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
268268
logfile: config.logfile.clone(),
269269
run_tests: true,
270270
run_benchmarks: true,
271-
ratchet_metrics: None,
272-
ratchet_noise_percent: None,
273-
save_metrics: None,
274-
test_shard: None,
275271
nocapture: false,
276272
color: test::AutoColor,
277-
show_boxplot: false,
278-
boxplot_width: 50,
279-
show_all_stats: false,
280273
}
281274
}
282275

branches/snap-stage3/src/libtest/lib.rs

+6-110
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,9 @@ pub struct TestOpts {
300300
pub run_ignored: bool,
301301
pub run_tests: bool,
302302
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)>,
307303
pub logfile: Option<Path>,
308304
pub nocapture: bool,
309305
pub color: ColorConfig,
310-
pub show_boxplot: bool,
311-
pub boxplot_width: uint,
312-
pub show_all_stats: bool,
313306
}
314307

315308
impl TestOpts {
@@ -320,16 +313,9 @@ impl TestOpts {
320313
run_ignored: false,
321314
run_tests: false,
322315
run_benchmarks: false,
323-
ratchet_metrics: None,
324-
ratchet_noise_percent: None,
325-
save_metrics: None,
326-
test_shard: None,
327316
logfile: None,
328317
nocapture: false,
329318
color: AutoColor,
330-
show_boxplot: false,
331-
boxplot_width: 50,
332-
show_all_stats: false,
333319
}
334320
}
335321
}
@@ -342,28 +328,14 @@ fn optgroups() -> Vec<getopts::OptGroup> {
342328
getopts::optflag("", "test", "Run tests and not benchmarks"),
343329
getopts::optflag("", "bench", "Run benchmarks instead of tests"),
344330
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"),
354331
getopts::optopt("", "logfile", "Write logs to the specified file instead \
355332
of stdout", "PATH"),
356-
getopts::optopt("", "test-shard", "run shard A, of B shards, worth of the testsuite",
357-
"A.B"),
358333
getopts::optflag("", "nocapture", "don't capture stdout/stderr of each \
359334
task, allow printing directly"),
360335
getopts::optopt("", "color", "Configure coloring of output:
361336
auto = colorize if stdout is a tty and tests are run on serially (default);
362337
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"))
367339
}
368340

369341
fn usage(binary: &str) {
@@ -428,19 +400,6 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
428400
let run_tests = ! run_benchmarks ||
429401
matches.opt_present("test");
430402

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-
444403
let mut nocapture = matches.opt_present("nocapture");
445404
if !nocapture {
446405
nocapture = os::getenv("RUST_TEST_NOCAPTURE").is_some();
@@ -456,63 +415,19 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
456415
v))),
457416
};
458417

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-
474418
let test_opts = TestOpts {
475419
filter: filter,
476420
run_ignored: run_ignored,
477421
run_tests: run_tests,
478422
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,
483423
logfile: logfile,
484424
nocapture: nocapture,
485425
color: color,
486-
show_boxplot: show_boxplot,
487-
boxplot_width: boxplot_width,
488-
show_all_stats: show_all_stats,
489426
};
490427

491428
Some(Ok(test_opts))
492429
}
493430

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-
516431
#[derive(Clone, PartialEq)]
517432
pub struct BenchSamples {
518433
ns_iter_summ: stats::Summary<f64>,
@@ -568,9 +483,9 @@ impl<T: Writer> ConsoleTestState<T> {
568483
out: out,
569484
log_out: log_out,
570485
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,
574489
total: 0u,
575490
passed: 0u,
576491
failed: 0u,
@@ -913,15 +828,7 @@ pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn> ) -> io::IoR
913828
None => {}
914829
}
915830
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!("\nmetrics 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);
925832
}
926833

927834
#[test]
@@ -1095,18 +1002,7 @@ pub fn filter_tests(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> Vec<TestDescA
10951002
// Sort the tests alphabetically
10961003
filtered.sort_by(|t1, t2| t1.desc.name.as_slice().cmp(t2.desc.name.as_slice()));
10971004

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
11101006
}
11111007

11121008
pub fn run_test(opts: &TestOpts,

0 commit comments

Comments
 (0)