Sha256: 0e8dc3e1a838033ca282fc178c87bd4d5414fb9b4ff3d66f5846d620a0f08abf
Contents?: true
Size: 1.5 KB
Versions: 2
Compression:
Stored size: 1.5 KB
Contents
#!/usr/bin/env ruby require 'test/unit' require 'ruby-prof' require 'test_helper' require 'prime' # -- Tests ---- class ClockModeTest < Test::Unit::TestCase def test_clock return RubyProf::clock_mode = RubyProf::PROCESS_TIME assert_equal(RubyProf::PROCESS_TIME, RubyProf::clock_mode) result = RubyProf.profile do run_primes end print_results(result) result.threads.values.each do |methods| methods.values.each do |method| check_parent_times(method) check_parent_calls(method) check_child_times(method) end end end def test_gettimeofday return RubyProf::clock_mode = RubyProf::WALL_TIME assert_equal(RubyProf::WALL_TIME, RubyProf::clock_mode) result = RubyProf.profile do run_primes end print_results(result) result.threads.values.each do |methods| methods.values.each do |method| check_parent_times(method) check_parent_calls(method) check_child_times(method) end end end def test_cpu #return RubyProf::clock_mode = RubyProf::CPU_TIME assert_equal(RubyProf::CPU, RubyProf::clock_mode) result = RubyProf.profile do run_primes end print_results(result) result.threads.values.each do |methods| methods.values.each do |method| check_parent_times(method) check_parent_calls(method) check_child_times(method) end end end def test_invalid assert_raise(ArgumentError) do RubyProf::clock_mode = 7777 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ruby-prof-0.4.1-mswin32 | test/clock_mode_test.rb |
ruby-prof-0.4.1 | test/clock_mode_test.rb |