summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorDaniel Bovensiepen <[email protected]>2012-06-21 16:00:04 +0800
committerDaniel Bovensiepen <[email protected]>2012-06-21 16:00:04 +0800
commit2ae84f7d8358628bd904993aef18edf27828d696 (patch)
tree9f8dd2bac82e2b106a6b0412ae7a1fbc215a025e /test
parent766ae4ee5f99ea96dac166a3dfa0791baa77f353 (diff)
downloadmruby-2ae84f7d8358628bd904993aef18edf27828d696.tar.gz
mruby-2ae84f7d8358628bd904993aef18edf27828d696.zip
Add execution time to tests
Diffstat (limited to 'test')
-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
+