From 8e80f8fb8dd4dd482ab6cdc2f4fd3b295f3430a1 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Wed, 9 Feb 2011 00:13:30 -0600 Subject: [PATCH] Print a table of runtime support when running the tests --- test/test_runtimes.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/test_runtimes.rb b/test/test_runtimes.rb index 06422da..25ce239 100644 --- a/test/test_runtimes.rb +++ b/test/test_runtimes.rb @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- require "execjs" require "test/unit" @@ -41,7 +42,16 @@ end def test_runtime(name) runtime = ExecJS::Runtimes.const_get(name) - if runtime.available? + ok = runtime.available? + + warn "%s %-14s %s" % + if ok + ["✓", name, "Found"] + else + [" ", name, "Not found"] + end + + if ok Class.new(Test::Unit::TestCase) do (class << self; self end).send(:define_method, :name) do "#{name}Test" @@ -53,11 +63,10 @@ def test_runtime(name) instance_variable_set(:@runtime, runtime) end end - else - warn "#{name} runtime is unavailable, skipping" end end +warn "Runtime support:" test_runtime :V8 test_runtime :Rhino test_runtime :ExternalV8 @@ -65,3 +74,4 @@ test_runtime :Node test_runtime :JSC test_runtime :Spidermonkey test_runtime :JScript +warn ""