Sha256: f3eafddafe3f1cba5d5d65ea9737d5df3314e579de5301dc9c2f0974eb7d67b0

Contents?: true

Size: 737 Bytes

Versions: 13

Compression:

Stored size: 737 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

require File.expand_path('../test_helper', __FILE__)

class MeasureGCRunsTest < TestCase
  include MemoryTestHelper

  def test_gc_runs_mode
    RubyProf::measure_mode = RubyProf::GC_RUNS
    assert_equal(RubyProf::GC_RUNS, RubyProf::measure_mode)
  end

  def test_gc_runs_enabled_defined
    assert(defined?(RubyProf::GC_RUNS_ENABLED))
  end

  if RubyProf::GC_RUNS_ENABLED
    def test_gc_runs
      t = RubyProf.measure_gc_runs
      assert_kind_of Integer, t

      GC.enable_stats if GC.respond_to?(:enable_stats)
      GC.start

      u = RubyProf.measure_gc_runs
      assert u > t, [t, u].inspect
      RubyProf::measure_mode = RubyProf::GC_RUNS
      memory_test_helper
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
ruby-prof-0.17.0 test/measure_gc_runs_test.rb
airbnb-ruby-prof-0.0.1 test/measure_gc_runs_test.rb
ruby-prof-0.16.2 test/measure_gc_runs_test.rb
ruby-prof-0.16.1 test/measure_gc_runs_test.rb
ruby-prof-0.16.0 test/measure_gc_runs_test.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/ruby-prof-0.15.9/test/measure_gc_runs_test.rb
ruby-prof-0.15.9 test/measure_gc_runs_test.rb
ruby-prof-0.15.8 test/measure_gc_runs_test.rb
ruby-prof-0.15.7 test/measure_gc_runs_test.rb
ruby-prof-0.15.6 test/measure_gc_runs_test.rb
ruby-prof-0.15.5 test/measure_gc_runs_test.rb
ruby-prof-0.15.4 test/measure_gc_runs_test.rb
ruby-prof-0.15.3 test/measure_gc_runs_test.rb