mirror of
https://github.com/rails/execjs
synced 2023-03-27 23:21:20 -04:00
Print a table of runtime support when running the tests
This commit is contained in:
parent
8b22842cbd
commit
8e80f8fb8d
1 changed files with 13 additions and 3 deletions
|
@ -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 ""
|
||||
|
|
Loading…
Reference in a new issue