diff options
Diffstat (limited to 'test/ripper/test_files.rb')
-rw-r--r-- | test/ripper/test_files.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ripper/test_files.rb b/test/ripper/test_files.rb index 7b5fa1dc6c..88222cf87d 100644 --- a/test/ripper/test_files.rb +++ b/test/ripper/test_files.rb @@ -7,14 +7,14 @@ class TestRipper::Generic < Test::Unit::TestCase srcdir = File.expand_path("../../..", __FILE__) assert_separately(%W[--disable-gem -rripper - #{srcdir}], __FILE__, __LINE__, <<-'eom', timeout: Float::INFINITY) - TEST_RATIO = 0.05 # testing all files needs too long time... + TEST_RATIO = ENV["TEST_RIPPER_RATIO"]&.tap {|s|break s.to_f} || 0.05 # testing all files needs too long time... class Parser < Ripper PARSER_EVENTS.each {|n| eval "def on_#{n}(*args) r = [:#{n}, *args]; r.inspect; Object.new end" } SCANNER_EVENTS.each {|n| eval "def on_#{n}(*args) r = [:#{n}, *args]; r.inspect; Object.new end" } end dir = ARGV.shift for script in Dir["#{dir}/{lib,sample,ext,test}/**/*.rb"].sort - next if TEST_RATIO < rand + next if TEST_RATIO and TEST_RATIO < rand assert_nothing_raised("ripper failed to parse: #{script.inspect}") { Parser.new(File.read(script), script).parse } |