about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-07-09 10:21:42 +0000
committerEric Wong <e@80x24.org>2018-07-15 01:01:24 +0000
commit46bdc110f85e29986b71a06b67f311e22c536f52 (patch)
tree483d87431f30320b4a071d6bad9703dadf010525
parentcec7a36a99fa98ac5611a184b7f1ad0af1d58828 (diff)
downloadmwrap-46bdc110f85e29986b71a06b67f311e22c536f52.tar.gz
-rw-r--r--test/test_mwrap.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_mwrap.rb b/test/test_mwrap.rb
index 63d9e23..3de9c1b 100644
--- a/test/test_mwrap.rb
+++ b/test/test_mwrap.rb
@@ -146,4 +146,13 @@ class TestMwrap < Test::Unit::TestCase
       assert_operator total, :>=, calls
     end
   end
+
+  def test_benchmark
+    cmd = @@cmd + %w(-rbenchmark
+      -e puts(Benchmark.measure{1000000.times{Time.now}}))
+    r = IO.popen(@@env, cmd, 'r')
+    require 'benchmark'
+    warn Benchmark::Tms::CAPTION
+    warn r.read
+  end if ENV['BENCHMARK']
 end