diff options
| author | bors <bors@rust-lang.org> | 2014-01-17 04:11:46 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-17 04:11:46 -0800 |
| commit | 7d75bbf50ddcf076d3cf294501346293060c5735 (patch) | |
| tree | dce8b453104085b367e7063deece14fe013515e5 | |
| parent | 93fb12e3d0644f6a8ddfa2ac1d6b0a1d8341e287 (diff) | |
| parent | 8f4edf9bf889bbb1f7bfb5bac4d0c825d2d5374d (diff) | |
| download | rust-7d75bbf50ddcf076d3cf294501346293060c5735.tar.gz rust-7d75bbf50ddcf076d3cf294501346293060c5735.zip | |
auto merge of #11601 : dguenther/rust/fix_test_summary, r=brson
The test run summary currently prints the wrong number of tests run. This PR fixes it by adding a newline to the log output, and also adds support for counting bench runs. Closes #11381
| -rwxr-xr-x | src/etc/check-summary.py | 26 | ||||
| -rw-r--r-- | src/libextra/test.rs | 2 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/etc/check-summary.py b/src/etc/check-summary.py index 272bbc6fbbd..de777c99729 100755 --- a/src/etc/check-summary.py +++ b/src/etc/check-summary.py @@ -7,13 +7,20 @@ if __name__ == '__main__': summaries = [] def summarise(fname): summary = {} - fd = open(fname) - for line in fd: - status, test = line.strip().split(' ', 1) - if not summary.has_key(status): - summary[status] = [] - summary[status].append(test) - summaries.append((fname, summary)) + with open(fname) as fd: + for line in fd: + splitline = line.strip().split(' ') + if len(splitline) == 1: + continue + status = splitline[0] + test = splitline[-1] + # track bench runs + if splitline[1] == 'ns/iter': + status = 'bench' + if not summary.has_key(status): + summary[status] = [] + summary[status].append(test) + summaries.append((fname, summary)) def count(t): return sum(map(lambda (f, s): len(s.get(t, [])), summaries)) logfiles = sys.argv[1:] @@ -21,8 +28,9 @@ if __name__ == '__main__': ok = count('ok') failed = count('failed') ignored = count('ignored') - print "summary of %d test runs: %d passed; %d failed; %d ignored" % \ - (len(logfiles), ok, failed, ignored) + measured = count('bench') + print "summary of %d test runs: %d passed; %d failed; %d ignored; %d measured" % \ + (len(logfiles), ok, failed, ignored, measured) print "" if failed > 0: print "failed tests:" diff --git a/src/libextra/test.rs b/src/libextra/test.rs index 8d4c4471c89..1e302781c4a 100644 --- a/src/libextra/test.rs +++ b/src/libextra/test.rs @@ -474,7 +474,7 @@ impl<T: Writer> ConsoleTestState<T> { match self.log_out { None => (), Some(ref mut o) => { - let s = format!("{} {}", match *result { + let s = format!("{} {}\n", match *result { TrOk => ~"ok", TrFailed => ~"failed", TrIgnored => ~"ignored", |
