Skip to content

Commit 81504f2

Browse files
committedJan 21, 2015
rollup merge of #21413: ahmedcharles/remove-test-features
This isn't the entire set of changes, there are more coming. #19145
2 parents 5d82c0f + 4f6f7e5 commit 81504f2

File tree

4 files changed

+6
-148
lines changed

4 files changed

+6
-148
lines changed
 

‎configure

-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@ opt optimize-tests 1 "build tests with optimizations"
509509
opt libcpp 1 "build with llvm with libc++ instead of libstdc++ when using clang"
510510
opt llvm-assertions 1 "build LLVM with assertions"
511511
opt debug 1 "build with extra debug fun"
512-
opt ratchet-bench 0 "ratchet benchmarks"
513512
opt fast-make 0 "use .gitmodules as timestamp for submodule deps"
514513
opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
515514
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"

‎src/compiletest/common.rs

-14
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,6 @@ pub struct Config {
115115
// Write out a parseable log of tests that were run
116116
pub logfile: Option<Path>,
117117

118-
// Write out a json file containing any metrics of the run
119-
pub save_metrics: Option<Path>,
120-
121-
// Write and ratchet a metrics file
122-
pub ratchet_metrics: Option<Path>,
123-
124-
// Percent change in metrics to consider noise
125-
pub ratchet_noise_percent: Option<f64>,
126-
127-
// "Shard" of the testsuite to pub run: this has the form of
128-
// two numbers (a,b), and causes only those tests with
129-
// positional order equal to a mod b to run.
130-
pub test_shard: Option<(uint,uint)>,
131-
132118
// A command line to prefix program execution with,
133119
// for running under valgrind
134120
pub runtool: Option<String>,

‎src/compiletest/compiletest.rs

-23
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ pub fn parse_config(args: Vec<String> ) -> Config {
7777
optopt("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS"),
7878
optflag("", "verbose", "run tests verbosely, showing all output"),
7979
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"),
8480
optflag("", "jit", "run tests under the JIT"),
8581
optopt("", "target", "the target to build for", "TARGET"),
8682
optopt("", "host", "the host to build for", "HOST"),
@@ -90,7 +86,6 @@ pub fn parse_config(args: Vec<String> ) -> Config {
9086
optopt("", "adb-path", "path to the android debugger", "PATH"),
9187
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
9288
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"),
9489
optflag("h", "help", "show this message"));
9590

9691
assert!(!args.is_empty());
@@ -152,12 +147,6 @@ pub fn parse_config(args: Vec<String> ) -> Config {
152147
filter: filter,
153148
cfail_regex: Regex::new(errors::EXPECTED_PATTERN).unwrap(),
154149
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>()),
161150
runtool: matches.opt_str("runtool"),
162151
host_rustcflags: matches.opt_str("host-rustcflags"),
163152
target_rustcflags: matches.opt_str("target-rustcflags"),
@@ -176,7 +165,6 @@ pub fn parse_config(args: Vec<String> ) -> Config {
176165
opt_str2(matches.opt_str("adb-test-dir")).as_slice() &&
177166
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
178167
lldb_python_dir: matches.opt_str("lldb-python-dir"),
179-
test_shard: test::opt_shard(matches.opt_str("test-shard")),
180168
verbose: matches.opt_present("verbose"),
181169
}
182170
}
@@ -210,10 +198,6 @@ pub fn log_config(config: &Config) {
210198
logv(c, format!("adb_test_dir: {:?}", config.adb_test_dir));
211199
logv(c, format!("adb_device_status: {}",
212200
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-
}
217201
logv(c, format!("verbose: {}", config.verbose));
218202
logv(c, format!("\n"));
219203
}
@@ -284,15 +268,8 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
284268
logfile: config.logfile.clone(),
285269
run_tests: true,
286270
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(),
291271
nocapture: false,
292272
color: test::AutoColor,
293-
show_boxplot: false,
294-
boxplot_width: 50,
295-
show_all_stats: false,
296273
}
297274
}
298275

‎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)
Please sign in to comment.