Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Show allocation info for tests and benchmarks #54

Merged
merged 2 commits into from

2 participants

@cgay
Owner

Does not show cumulative allocation for suites since that's too likely to result in integer overflows. Shows "0B" on non-HARP back-ends.

@waywardmonkeys waywardmonkeys merged commit 2562c36 into dylan-lang:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 9, 2014
  1. @cgay

    Show allocation info for tests and benchmarks. Do not show cumulative…

    cgay authored
    … allocation for suites since that's likely to overflow <integer>.
  2. @cgay
This page is out of date. Refresh to see the latest.
Showing with 24 additions and 3 deletions.
  1. +8 −3 run.dylan
  2. +16 −0 utils.dylan
View
11 run.dylan
@@ -266,10 +266,15 @@ define method show-progress
let verbose? = runner.runner-progress = $verbose;
if (result)
let reason = result.result-reason;
- test-output("%s%s in %ss\n",
- verbose? & " test " | " ",
+ test-output("%s%s in %ss and %s\n",
+ if (verbose?)
+ format-to-string(" %s ", test.component-type-name)
+ else
+ " "
+ end,
result.result-status.status-name.as-uppercase,
- result.result-time);
+ result.result-time,
+ format-bytes(result.result-bytes));
reason & test-output(" %s\n", reason);
else
test-output("Running %s %s:%s",
View
16 utils.dylan
@@ -98,3 +98,19 @@ define method tags-match?
#t
end block
end method tags-match?;
+
+
+// Might want to put an extended version of this in the io:format module.
+define function format-bytes
+ (bytes :: <integer>) => (string :: <string>)
+ let (divisor, units) = case
+ bytes <= 1024 =>
+ values(1, "B");
+ bytes <= ash(1, 20) =>
+ values(1024, "KiB");
+ otherwise =>
+ values(ash(1, 20), "MiB");
+ // Need more bits in our integers...
+ end;
+ concatenate(integer-to-string(round/(bytes, divisor)), units)
+end function format-bytes;
Something went wrong with that request. Please try again.