Change:
libtest output recently started indenting some but not all test results: Seems like benchmarks are indented but regular tests are not.
Cc any idea which change might have caused this? I think this must be fairly recent but haven't tried bisecting yet.
Is this still reproducable?
With this can no longer be tested using x.py, since bootstrap now does test output formatting itself. So this now needs a little cargo project with a test and a benchmark, to check what libtest actually does.
It is because benches are dynamic, and they always use padding (and tests are static): I'm not sure why padding is different for static vs dynamic. Here is a repro:
Seems like that could use context if the bench is only being run as a test, then don't pad. The padding is desirable for benchmark output so the numeric values line up, for easier visual comparison. You could argue either way about tests -- maybe ok/FAILED would stand out even more with padded alignment.
PR with regression tests and a fix (in that order):

Discussion:
let mut filtered = FilteredTests { tests: Vec::new(), benches: Vec::new(), next_id: 0 }; <del> for test in filter_tests(opts, tests) { </del> <ins> let mut filtered_tests = filter_tests(opts, tests); if !opts.bench_benchmarks { filtered_tests = convert_benchmarks_to_tests(filtered_tests); } for test in filtered_tests { </ins> let mut desc = test.desc; desc.name = desc.name.with_padding(test.testfn.padding()); match test.testfn { <del> DynBenchFn(benchfn) => { if opts.bench_benchmarks { filtered.add_bench(desc, DynBenchFn(benchfn)); } else { filtered.add_test(desc, DynBenchAsTestFn(benchfn)); } } StaticBenchFn(benchfn) => { if opts.bench_benchmarks { filtered.add_bench(desc, StaticBenchFn(benchfn)); } else { filtered.add_test(desc, StaticBenchAsTestFn(benchfn)); } </del> <ins> DynBenchFn(_) | StaticBenchFn(_) => { filtered.add_bench(desc, test.testfn); </ins> } testfn => { filtered.add_test(desc, testfn);

<ins> # ignore-cross-compile because we run the compiled code # needs-unwind because #[bench] and -Cpanic=abort requires -Zpanic-abort-tests include ../tools.mk NORMALIZE=sed 's%[0-9,]{1,} ns/iter (+/- [0-9,]{1,})%?? ns/iter (+/- ??)%' | sed 's%finished in [0-9.]{1,}%finished in ??%' all: $(RUSTC) --test tests.rs $(call RUN,tests) --test-threads=1 | $(NORMALIZE) > "$(TMPDIR)"/test.stdout $(RUSTC_TEST_OP) "$(TMPDIR)"/test.stdout test.stdout $(call RUN,tests) --test-threads=1 --bench | $(NORMALIZE) > "$(TMPDIR)"/bench.stdout $(RUSTC_TEST_OP) "$(TMPDIR)"/bench.stdout bench.stdout </ins>

<ins> running 4 tests test short_test_name ... ignored test this_is_a_really_long_test_name ... ignored test short_bench_name                 ... bench:           ?? ns/iter (+/- ??) test this_is_a_really_long_bench_name ... bench:           ?? ns/iter (+/- ??) test result: ok. 0 passed; 0 failed; 2 ignored; 2 measured; 0 filtered out; finished in ??s </ins>

<ins> running 4 tests test short_bench_name ... ok test short_test_name ... ok test this_is_a_really_long_bench_name ... ok test this_is_a_really_long_test_name ... ok test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in ??s </ins>

<ins> #![feature(test)] extern crate test; #[test] fn short_test_name() {} #[test] fn this_is_a_really_long_test_name() {} #[bench] fn short_bench_name(b: &mut test::Bencher) { b.iter(|| 1); } #[bench] fn this_is_a_really_long_bench_name(b: &mut test::Bencher) { b.iter(|| 1); } </ins>