Class: Test::Unit::UI::Tap::PerlTestRunner

Inherits:
BaseTestRunner
  • Object
show all
Defined in:
lib/test/unit/ui/tap/perl_testrunner.rb

Overview

Outputs test results in traditional TAP format, version 12.

Constant Summary

Constants inherited from BaseTestRunner

BaseTestRunner::REVISION

Instance Method Summary collapse

Methods inherited from BaseTestRunner

#initialize

Constructor Details

This class inherits a constructor from Test::Unit::UI::Tap::BaseTestRunner

Instance Method Details

#tapout_after_suite(time) ⇒ Object



76
77
78
79
80
81
# File 'lib/test/unit/ui/tap/perl_testrunner.rb', line 76

def tapout_after_suite(time)
  puts("# Finished in #{time} seconds.")
  @result.to_s.each_line do |line|
    puts("# #{line}")
  end
end

#tapout_before_suite(suite) ⇒ Object



14
15
16
17
18
# File 'lib/test/unit/ui/tap/perl_testrunner.rb', line 14

def tapout_before_suite(suite)
  doc = super(suite)
  @i = 0
  puts "1..#{doc['count']}"
end

#tapout_error(fault) ⇒ Object



40
41
42
43
44
45
46
47
# File 'lib/test/unit/ui/tap/perl_testrunner.rb', line 40

def tapout_error(fault)
  doc = super(fault)
  if doc
    @i += 1
    puts "not ok #{@i} - #{doc['label']}(#{@test_case.name})"
    puts subdata(doc, 'ERROR')
  end
end

#tapout_fail(fault) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/test/unit/ui/tap/perl_testrunner.rb', line 30

def tapout_fail(fault)
  doc = super(fault)
  if doc
    @i += 1
    puts "not ok #{@i} - #{doc['label']}(#{@test_case.name})"
    puts subdata(doc, 'FAIL')
  end
end

#tapout_note(note) ⇒ Object



70
71
72
73
# File 'lib/test/unit/ui/tap/perl_testrunner.rb', line 70

def tapout_note(note)
  doc = super(note)
  puts '# ' + doc['text'].gsub("\n", "\n# ")
end

#tapout_omit(fault) ⇒ Object



50
51
52
53
54
55
56
57
# File 'lib/test/unit/ui/tap/perl_testrunner.rb', line 50

def tapout_omit(fault)
  doc = super(fault)
  if doc
    @i += 1
    puts "not ok #{@i} - #{doc['label']}(#{@test_case.name})  # SKIP"
    puts subdata(doc, 'SKIP')
  end
end

#tapout_pass(test) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/test/unit/ui/tap/perl_testrunner.rb', line 21

def tapout_pass(test)
  doc = super(test)
  if doc
    @i += 1
    puts "ok #{@i} - #{doc['label']}(#{@test_case.name})"
  end
end

#tapout_todo(fault) ⇒ Object



60
61
62
63
64
65
66
67
# File 'lib/test/unit/ui/tap/perl_testrunner.rb', line 60

def tapout_todo(fault)
  doc = super(fault)
  if doc
    @i += 1
    puts "not ok #{@i} - #{doc['label']}(#{@test_case.name})  # TODO"
    puts subdata(doc, 'TODO')
  end
end