mwrap user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH] add benchmark
@ 2018-07-09 10:21 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2018-07-09 10:21 UTC (permalink / raw)
  To: mwrap-public

---
 test/test_mwrap.rb | 9 +++++++++
 1 file changed, 9 insertions(+)

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
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-07-09 10:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-09 10:21 [PATCH] add benchmark Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mwrap.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).