Skip to content

Commit

Permalink
Add execution time to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bovi committed Jun 21, 2012
1 parent 766ae4e commit 2ae84f7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/assert.rb
Expand Up @@ -2,6 +2,7 @@
$ko_test = 0
$kill_test = 0
$asserts = []
$test_start = Time.now if Object.const_defined?(:Time)

##
# Print the assertion in a readable way
Expand Down Expand Up @@ -68,6 +69,12 @@ def report()
print('Crash: ')
print($kill_test)
print("\n")

if Object.const_defined?(:Time)
print(' Time: ')
print(Time.now - $test_start)
print(" seconds\n")
end
end

##
Expand All @@ -83,3 +90,4 @@ def check_float(a, b)
true
end
end

0 comments on commit 2ae84f7

Please sign in to comment.