File: monitor.rb

package info (click to toggle)
gonzui 1.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,824 kB
  • ctags: 1,448
  • sloc: ruby: 9,570; sh: 5,684; ansic: 1,334; lex: 1,140; makefile: 466; perl: 205; ml: 131
file content (26 lines) | stat: -rwxr-xr-x 553 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/env ruby
$LOAD_PATH.unshift("..")
require 'test/unit'
require 'gonzui'
require 'test-util'
include Gonzui

class MonitorTest < Test::Unit::TestCase
  include TestUtil

  def foo
    1
  end

  def test_monitor
    monitor = PerformanceMonitor.new
    assert(monitor.empty?)
    assert_equal("", monitor.format([MonitorTest, :foo]))
    monitor.profile(self, :foo)
    assert(!monitor.empty?)
    summary = monitor.format([MonitorTest, :foo],
                             [MonitorTest, :foo])
    assert(summary.is_a?(String))
    
  end
end