piko-max-mod 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/piko-max-mod.gemspec +12 -0
- data/test-unit-3.7.8/BSDL +24 -0
- data/test-unit-3.7.8/COPYING +64 -0
- data/test-unit-3.7.8/PSFL +271 -0
- data/test-unit-3.7.8/README.md +108 -0
- data/test-unit-3.7.8/Rakefile +74 -0
- data/test-unit-3.7.8/bin/test-unit +5 -0
- data/test-unit-3.7.8/doc/text/getting-started.md +120 -0
- data/test-unit-3.7.8/doc/text/how-to.md +90 -0
- data/test-unit-3.7.8/doc/text/news.md +2070 -0
- data/test-unit-3.7.8/lib/test/unit/assertion-failed-error.rb +60 -0
- data/test-unit-3.7.8/lib/test/unit/assertions.rb +2536 -0
- data/test-unit-3.7.8/lib/test/unit/attribute-matcher.rb +26 -0
- data/test-unit-3.7.8/lib/test/unit/attribute.rb +228 -0
- data/test-unit-3.7.8/lib/test/unit/auto-runner-loader.rb +17 -0
- data/test-unit-3.7.8/lib/test/unit/autorunner.rb +654 -0
- data/test-unit-3.7.8/lib/test/unit/code-snippet-fetcher.rb +58 -0
- data/test-unit-3.7.8/lib/test/unit/collector/descendant.rb +20 -0
- data/test-unit-3.7.8/lib/test/unit/collector/dir.rb +110 -0
- data/test-unit-3.7.8/lib/test/unit/collector/load.rb +201 -0
- data/test-unit-3.7.8/lib/test/unit/collector/objectspace.rb +35 -0
- data/test-unit-3.7.8/lib/test/unit/collector/xml.rb +249 -0
- data/test-unit-3.7.8/lib/test/unit/collector.rb +104 -0
- data/test-unit-3.7.8/lib/test/unit/color-scheme.rb +225 -0
- data/test-unit-3.7.8/lib/test/unit/color.rb +134 -0
- data/test-unit-3.7.8/lib/test/unit/data-sets.rb +127 -0
- data/test-unit-3.7.8/lib/test/unit/data.rb +371 -0
- data/test-unit-3.7.8/lib/test/unit/diff.rb +745 -0
- data/test-unit-3.7.8/lib/test/unit/error.rb +158 -0
- data/test-unit-3.7.8/lib/test/unit/exception-handler.rb +82 -0
- data/test-unit-3.7.8/lib/test/unit/failure.rb +169 -0
- data/test-unit-3.7.8/lib/test/unit/fault-location-detector.rb +104 -0
- data/test-unit-3.7.8/lib/test/unit/fixture.rb +304 -0
- data/test-unit-3.7.8/lib/test/unit/notification.rb +138 -0
- data/test-unit-3.7.8/lib/test/unit/omission.rb +198 -0
- data/test-unit-3.7.8/lib/test/unit/pending.rb +155 -0
- data/test-unit-3.7.8/lib/test/unit/priority.rb +194 -0
- data/test-unit-3.7.8/lib/test/unit/process-test-result.rb +55 -0
- data/test-unit-3.7.8/lib/test/unit/process-worker.rb +87 -0
- data/test-unit-3.7.8/lib/test/unit/runner/console.rb +86 -0
- data/test-unit-3.7.8/lib/test/unit/runner/emacs.rb +8 -0
- data/test-unit-3.7.8/lib/test/unit/runner/xml.rb +15 -0
- data/test-unit-3.7.8/lib/test/unit/sub-test-result.rb +59 -0
- data/test-unit-3.7.8/lib/test/unit/test-process-run-context.rb +21 -0
- data/test-unit-3.7.8/lib/test/unit/test-run-context.rb +16 -0
- data/test-unit-3.7.8/lib/test/unit/test-suite-creator.rb +103 -0
- data/test-unit-3.7.8/lib/test/unit/test-suite-process-runner.rb +205 -0
- data/test-unit-3.7.8/lib/test/unit/test-suite-runner.rb +132 -0
- data/test-unit-3.7.8/lib/test/unit/test-suite-thread-runner.rb +96 -0
- data/test-unit-3.7.8/lib/test/unit/test-thread-run-context.rb +23 -0
- data/test-unit-3.7.8/lib/test/unit/testcase.rb +1058 -0
- data/test-unit-3.7.8/lib/test/unit/testresult.rb +132 -0
- data/test-unit-3.7.8/lib/test/unit/testsuite.rb +133 -0
- data/test-unit-3.7.8/lib/test/unit/ui/console/outputlevel.rb +15 -0
- data/test-unit-3.7.8/lib/test/unit/ui/console/testrunner.rb +891 -0
- data/test-unit-3.7.8/lib/test/unit/ui/emacs/testrunner.rb +49 -0
- data/test-unit-3.7.8/lib/test/unit/ui/testrunner.rb +53 -0
- data/test-unit-3.7.8/lib/test/unit/ui/testrunnermediator.rb +131 -0
- data/test-unit-3.7.8/lib/test/unit/ui/testrunnerutilities.rb +41 -0
- data/test-unit-3.7.8/lib/test/unit/ui/xml/testrunner.rb +225 -0
- data/test-unit-3.7.8/lib/test/unit/util/backtracefilter.rb +65 -0
- data/test-unit-3.7.8/lib/test/unit/util/memory-usage.rb +47 -0
- data/test-unit-3.7.8/lib/test/unit/util/method-owner-finder.rb +28 -0
- data/test-unit-3.7.8/lib/test/unit/util/observable.rb +86 -0
- data/test-unit-3.7.8/lib/test/unit/util/output.rb +32 -0
- data/test-unit-3.7.8/lib/test/unit/util/procwrapper.rb +48 -0
- data/test-unit-3.7.8/lib/test/unit/version.rb +5 -0
- data/test-unit-3.7.8/lib/test/unit/warning.rb +3 -0
- data/test-unit-3.7.8/lib/test/unit/worker-context.rb +20 -0
- data/test-unit-3.7.8/lib/test/unit.rb +521 -0
- data/test-unit-3.7.8/lib/test-unit.rb +19 -0
- data/test-unit-3.7.8/sample/adder.rb +13 -0
- data/test-unit-3.7.8/sample/subtracter.rb +12 -0
- data/test-unit-3.7.8/sample/test_adder.rb +20 -0
- data/test-unit-3.7.8/sample/test_subtracter.rb +20 -0
- data/test-unit-3.7.8/sample/test_user.rb +23 -0
- metadata +117 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# Author:: Nathaniel Talbott.
|
|
3
|
+
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
|
|
4
|
+
# License:: Ruby license.
|
|
5
|
+
|
|
6
|
+
require_relative 'util/observable'
|
|
7
|
+
require_relative 'failure'
|
|
8
|
+
require_relative 'error'
|
|
9
|
+
require_relative 'omission'
|
|
10
|
+
require_relative 'pending'
|
|
11
|
+
require_relative 'notification'
|
|
12
|
+
|
|
13
|
+
module Test
|
|
14
|
+
module Unit
|
|
15
|
+
module NullResultContainerInitializer
|
|
16
|
+
private
|
|
17
|
+
def initialize_containers
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Collects Test::Unit::Failure and Test::Unit::Error so that
|
|
22
|
+
# they can be displayed to the user. To this end, observers
|
|
23
|
+
# can be added to it, allowing the dynamic updating of, say, a
|
|
24
|
+
# UI.
|
|
25
|
+
class TestResult
|
|
26
|
+
include Util::Observable
|
|
27
|
+
include NullResultContainerInitializer
|
|
28
|
+
include TestResultFailureSupport
|
|
29
|
+
include TestResultErrorSupport
|
|
30
|
+
include TestResultPendingSupport
|
|
31
|
+
include TestResultOmissionSupport
|
|
32
|
+
include TestResultNotificationSupport
|
|
33
|
+
|
|
34
|
+
FINISHED = name + "::FINISHED"
|
|
35
|
+
CHANGED = name + "::CHANGED"
|
|
36
|
+
PASS_ASSERTION = name + "::PASS_ASSERTION"
|
|
37
|
+
FAULT = name + "::FAULT"
|
|
38
|
+
|
|
39
|
+
attr_reader :run_count, :pass_count, :assertion_count, :faults
|
|
40
|
+
|
|
41
|
+
attr_accessor :stop_tag
|
|
42
|
+
|
|
43
|
+
# Constructs a new, empty TestResult.
|
|
44
|
+
def initialize
|
|
45
|
+
@run_count, @pass_count, @assertion_count = 0, 0, 0
|
|
46
|
+
@summary_generators = []
|
|
47
|
+
@problem_checkers = []
|
|
48
|
+
@faults = []
|
|
49
|
+
@stop_tag = nil
|
|
50
|
+
initialize_containers
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Records a test run.
|
|
54
|
+
def add_run(result=self)
|
|
55
|
+
@run_count += 1
|
|
56
|
+
notify_listeners(FINISHED, result)
|
|
57
|
+
notify_changed
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def add_pass
|
|
61
|
+
@pass_count += 1
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Records an individual assertion.
|
|
65
|
+
def add_assertion
|
|
66
|
+
@assertion_count += 1
|
|
67
|
+
notify_listeners(PASS_ASSERTION, self)
|
|
68
|
+
notify_changed
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns a string contain the recorded runs, assertions,
|
|
72
|
+
# failures and errors in this TestResult.
|
|
73
|
+
def summary
|
|
74
|
+
["#{run_count} tests",
|
|
75
|
+
"#{assertion_count} assertions",
|
|
76
|
+
*@summary_generators.collect {|generator| __send__(generator)}].join(", ")
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Returns a string that shows result status.
|
|
80
|
+
def status
|
|
81
|
+
if passed?
|
|
82
|
+
if pending_count > 0
|
|
83
|
+
"pending"
|
|
84
|
+
elsif omission_count > 0
|
|
85
|
+
"omission"
|
|
86
|
+
elsif notification_count > 0
|
|
87
|
+
"notification"
|
|
88
|
+
else
|
|
89
|
+
"pass"
|
|
90
|
+
end
|
|
91
|
+
elsif error_count > 0
|
|
92
|
+
"error"
|
|
93
|
+
elsif failure_count > 0
|
|
94
|
+
"failure"
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def stop
|
|
99
|
+
throw @stop_tag
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def to_s
|
|
103
|
+
summary
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Returns whether or not this TestResult represents
|
|
107
|
+
# successful completion.
|
|
108
|
+
def passed?
|
|
109
|
+
@problem_checkers.all? {|checker| not __send__(checker)}
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def pass_percentage
|
|
113
|
+
n_tests = @run_count - omission_count
|
|
114
|
+
if n_tests.zero?
|
|
115
|
+
0
|
|
116
|
+
else
|
|
117
|
+
100.0 * (@pass_count / n_tests.to_f)
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
private
|
|
122
|
+
def notify_changed
|
|
123
|
+
notify_listeners(CHANGED, self)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def notify_fault(fault)
|
|
127
|
+
@faults << fault
|
|
128
|
+
notify_listeners(FAULT, fault)
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
#--
|
|
2
|
+
#
|
|
3
|
+
# Author:: Nathaniel Talbott.
|
|
4
|
+
# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
|
|
5
|
+
# Copyright:: Copyright (c) 2008-2011 Kouhei Sutou. All rights reserved.
|
|
6
|
+
# License:: Ruby license.
|
|
7
|
+
|
|
8
|
+
require_relative 'error'
|
|
9
|
+
require_relative 'test-suite-runner'
|
|
10
|
+
|
|
11
|
+
module Test
|
|
12
|
+
module Unit
|
|
13
|
+
|
|
14
|
+
# A collection of tests which can be #run.
|
|
15
|
+
#
|
|
16
|
+
# Note: It is easy to confuse a TestSuite instance with
|
|
17
|
+
# something that has a static suite method; I know because _I_
|
|
18
|
+
# have trouble keeping them straight. Think of something that
|
|
19
|
+
# has a suite method as simply providing a way to get a
|
|
20
|
+
# meaningful TestSuite instance.
|
|
21
|
+
class TestSuite
|
|
22
|
+
attr_reader :name, :tests, :test_case, :start_time, :elapsed_time
|
|
23
|
+
|
|
24
|
+
# Test suite that has higher priority is ran prior to
|
|
25
|
+
# test suites that have lower priority.
|
|
26
|
+
attr_accessor :priority
|
|
27
|
+
|
|
28
|
+
STARTED = name + "::STARTED"
|
|
29
|
+
STARTED_OBJECT = name + "::STARTED::OBJECT"
|
|
30
|
+
FINISHED = name + "::FINISHED"
|
|
31
|
+
FINISHED_OBJECT = name + "::FINISHED::OBJECT"
|
|
32
|
+
|
|
33
|
+
# Creates a new TestSuite with the given name.
|
|
34
|
+
def initialize(name="Unnamed TestSuite", test_case=nil)
|
|
35
|
+
@name = name
|
|
36
|
+
@tests = []
|
|
37
|
+
@test_case = test_case
|
|
38
|
+
@priority = 0
|
|
39
|
+
@start_time = nil
|
|
40
|
+
@elapsed_time = nil
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def find(name)
|
|
44
|
+
return self if @name == name
|
|
45
|
+
@tests.each do |test|
|
|
46
|
+
if test.is_a?(self.class)
|
|
47
|
+
t = test.find(name)
|
|
48
|
+
return t if t
|
|
49
|
+
else
|
|
50
|
+
return test if test.name == name
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
nil
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def parallel_safe?
|
|
57
|
+
return true if @test_case.nil?
|
|
58
|
+
@test_case.parallel_safe?
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def have_fixture?
|
|
62
|
+
return false if @test_case.nil?
|
|
63
|
+
return true if @test_case.method(:startup).owner != TestCase.singleton_class
|
|
64
|
+
return true if @test_case.method(:shutdown).owner != TestCase.singleton_class
|
|
65
|
+
false
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Runs the tests and/or suites contained in this
|
|
69
|
+
# TestSuite.
|
|
70
|
+
def run(worker_context, &progress_block)
|
|
71
|
+
run_context = worker_context.run_context
|
|
72
|
+
if run_context
|
|
73
|
+
runner_class = run_context.runner_class
|
|
74
|
+
else
|
|
75
|
+
runner_class = TestSuiteRunner
|
|
76
|
+
end
|
|
77
|
+
runner_class.new(self).run(worker_context) do |event, *args|
|
|
78
|
+
case event
|
|
79
|
+
when STARTED
|
|
80
|
+
@start_time = Time.now
|
|
81
|
+
when FINISHED
|
|
82
|
+
@elapsed_time = Time.now - @start_time
|
|
83
|
+
end
|
|
84
|
+
yield(event, *args)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Adds the test to the suite.
|
|
89
|
+
def <<(test)
|
|
90
|
+
@tests << test
|
|
91
|
+
self
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def delete(test)
|
|
95
|
+
@tests.delete(test)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def delete_tests(tests)
|
|
99
|
+
@tests -= tests
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Returns the rolled up number of tests in this suite;
|
|
103
|
+
# i.e. if the suite contains other suites, it counts the
|
|
104
|
+
# tests within those suites, not the suites themselves.
|
|
105
|
+
def size
|
|
106
|
+
total_size = 0
|
|
107
|
+
@tests.each { |test| total_size += test.size }
|
|
108
|
+
total_size
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def empty?
|
|
112
|
+
size.zero?
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Overridden to return the name given the suite at
|
|
116
|
+
# creation.
|
|
117
|
+
def to_s
|
|
118
|
+
@name
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# It's handy to be able to compare TestSuite instances.
|
|
122
|
+
def ==(other)
|
|
123
|
+
return false unless(other.kind_of?(self.class))
|
|
124
|
+
return false unless(@name == other.name)
|
|
125
|
+
@tests == other.tests
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def passed?
|
|
129
|
+
@tests.all?(&:passed?)
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|