Skip to content

Commit

Permalink
Update test run summary
Browse files Browse the repository at this point in the history
  • Loading branch information
dguenther committed Jan 16, 2014
1 parent f63a7f5 commit 8f4edf9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
26 changes: 17 additions & 9 deletions src/etc/check-summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,30 @@
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:]
map(summarise, logfiles)
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:"
Expand Down
2 changes: 1 addition & 1 deletion src/libextra/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

9 comments on commit 8f4edf9

@bors
Copy link
Contributor

@bors bors commented on 8f4edf9 Jan 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from brson
at dguenther@8f4edf9

@bors
Copy link
Contributor

@bors bors commented on 8f4edf9 Jan 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging dguenther/rust/fix_test_summary = 8f4edf9 into auto

@bors
Copy link
Contributor

@bors bors commented on 8f4edf9 Jan 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dguenther/rust/fix_test_summary = 8f4edf9 merged ok, testing candidate = da6842f1

@bors
Copy link
Contributor

@bors bors commented on 8f4edf9 Jan 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from brson
at dguenther@8f4edf9

@bors
Copy link
Contributor

@bors bors commented on 8f4edf9 Jan 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging dguenther/rust/fix_test_summary = 8f4edf9 into auto

@bors
Copy link
Contributor

@bors bors commented on 8f4edf9 Jan 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dguenther/rust/fix_test_summary = 8f4edf9 merged ok, testing candidate = 7d75bbf

@bors
Copy link
Contributor

@bors bors commented on 8f4edf9 Jan 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 8f4edf9 Jan 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 7d75bbf

Please sign in to comment.