summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-06-21 02:56:29 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-06-21 02:56:29 -0700
commit2109556188a006ec80f0453d576ec873c9b62b67 (patch)
tree6a077e95d8c6ffc2abec73259b80593047863dc1
parent8dcf0bc259d64afc10ad9fa717e43a901b1f15b5 (diff)
parent2ae84f7d8358628bd904993aef18edf27828d696 (diff)
downloadmruby-2109556188a006ec80f0453d576ec873c9b62b67.tar.gz
mruby-2109556188a006ec80f0453d576ec873c9b62b67.zip
Merge pull request #307 from bovi/time-for-tests
Add execution time to tests
-rw-r--r--test/assert.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/assert.rb b/test/assert.rb
index 2fc11f149..9329638c9 100644
--- a/test/assert.rb
+++ b/test/assert.rb
@@ -2,6 +2,7 @@ $ok_test = 0
$ko_test = 0
$kill_test = 0
$asserts = []
+$test_start = Time.now if Object.const_defined?(:Time)
##
# Print the assertion in a readable way
@@ -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
##
@@ -83,3 +90,4 @@ def check_float(a, b)
true
end
end
+