uttk 0.3.1.2
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.
- data/AUTHORS +36 -0
- data/COPYING +18 -0
- data/ChangeLog +7673 -0
- data/GUIDELINES +86 -0
- data/LGPL +504 -0
- data/NEWS +158 -0
- data/NORM +137 -0
- data/README +180 -0
- data/Rakefile +8 -0
- data/SPEC.gemspec +15 -0
- data/SPEC.yml +60 -0
- data/TODO +23 -0
- data/TODO.old +31 -0
- data/VERSION +5 -0
- data/bin/getopts/uttk.rb +390 -0
- data/bin/uttk +188 -0
- data/bin/uttk-unit +125 -0
- data/lib/uttk.rb +288 -0
- data/lib/uttk/dumpers/Basic.rb +23 -0
- data/lib/uttk/dumpers/BasicColor.rb +35 -0
- data/lib/uttk/dumpers/Dumper.rb +77 -0
- data/lib/uttk/dumpers/Html.rb +271 -0
- data/lib/uttk/dumpers/Path.rb +24 -0
- data/lib/uttk/dumpers/Xml.rb +88 -0
- data/lib/uttk/dumpers/Yaml.rb +138 -0
- data/lib/uttk/filters.rb +128 -0
- data/lib/uttk/filters/Buffer.rb +119 -0
- data/lib/uttk/filters/Compact.rb +75 -0
- data/lib/uttk/filters/Default.rb +27 -0
- data/lib/uttk/filters/DefaultColor.rb +27 -0
- data/lib/uttk/filters/Filter.rb +53 -0
- data/lib/uttk/filters/Id.rb +30 -0
- data/lib/uttk/filters/JustStatus.rb +25 -0
- data/lib/uttk/filters/KeepSkipBased.rb +38 -0
- data/lib/uttk/filters/NodeCut.rb +97 -0
- data/lib/uttk/filters/RPathFilter.rb +134 -0
- data/lib/uttk/filters/Saver.rb +53 -0
- data/lib/uttk/filters/TextFilter.rb +69 -0
- data/lib/uttk/generators/dumper_generator.rb +28 -0
- data/lib/uttk/generators/filter_generator.rb +28 -0
- data/lib/uttk/generators/generator.rb +86 -0
- data/lib/uttk/generators/generator_generator.rb +26 -0
- data/lib/uttk/generators/loader_generator.rb +28 -0
- data/lib/uttk/generators/path_filter_generator.rb +28 -0
- data/lib/uttk/generators/strategy_generator.rb +28 -0
- data/lib/uttk/generators/templates/dumper.rb +50 -0
- data/lib/uttk/generators/templates/filter.rb +50 -0
- data/lib/uttk/generators/templates/generator.rb +28 -0
- data/lib/uttk/generators/templates/loader.rb +26 -0
- data/lib/uttk/generators/templates/path_filter.rb +28 -0
- data/lib/uttk/generators/templates/strategy.rb +59 -0
- data/lib/uttk/generators/templates/strategy.yml +28 -0
- data/lib/uttk/generators/templates/unit_test.rb +46 -0
- data/lib/uttk/loaders/Loader.rb +180 -0
- data/lib/uttk/loaders/Ruby.rb +28 -0
- data/lib/uttk/loaders/Yaml.rb +98 -0
- data/lib/uttk/logger.rb +306 -0
- data/lib/uttk/logger/backend.rb +170 -0
- data/lib/uttk/logger/path.rb +202 -0
- data/lib/uttk/logger/section_node.rb +214 -0
- data/lib/uttk/logger/severity.rb +63 -0
- data/lib/uttk/logger/to_uttk_log.rb +127 -0
- data/lib/uttk/logger/verbosity.rb +61 -0
- data/lib/uttk/logger_factory.rb +55 -0
- data/lib/uttk/path_filters/ColorStatus.rb +57 -0
- data/lib/uttk/path_filters/PathFilter.rb +27 -0
- data/lib/uttk/path_filters/RemoveTypes.rb +25 -0
- data/lib/uttk/status.rb +146 -0
- data/lib/uttk/strategies/Abort.rb +24 -0
- data/lib/uttk/strategies/Assert.rb +44 -0
- data/lib/uttk/strategies/Authors.rb +45 -0
- data/lib/uttk/strategies/Block.rb +113 -0
- data/lib/uttk/strategies/Bootstrap.rb +55 -0
- data/lib/uttk/strategies/Checkout.rb +64 -0
- data/lib/uttk/strategies/Clean.rb +29 -0
- data/lib/uttk/strategies/Cmd.rb +60 -0
- data/lib/uttk/strategies/CmdBase.rb +130 -0
- data/lib/uttk/strategies/Collection.rb +158 -0
- data/lib/uttk/strategies/Compile.rb +59 -0
- data/lib/uttk/strategies/Composite.rb +201 -0
- data/lib/uttk/strategies/Composite/contents_eval.rb +40 -0
- data/lib/uttk/strategies/Configure.rb +66 -0
- data/lib/uttk/strategies/Error.rb +23 -0
- data/lib/uttk/strategies/Fail.rb +26 -0
- data/lib/uttk/strategies/IOBased.rb +159 -0
- data/lib/uttk/strategies/Import.rb +60 -0
- data/lib/uttk/strategies/Iterate.rb +139 -0
- data/lib/uttk/strategies/JUnit.rb +205 -0
- data/lib/uttk/strategies/KillAll.rb +62 -0
- data/lib/uttk/strategies/Make.rb +94 -0
- data/lib/uttk/strategies/Package.rb +129 -0
- data/lib/uttk/strategies/PackageCollection.rb +78 -0
- data/lib/uttk/strategies/Pass.rb +24 -0
- data/lib/uttk/strategies/Pool.rb +104 -0
- data/lib/uttk/strategies/ProbabilityThreshold.rb +46 -0
- data/lib/uttk/strategies/Proxy.rb +42 -0
- data/lib/uttk/strategies/RMatch.rb +92 -0
- data/lib/uttk/strategies/RUnit.rb +132 -0
- data/lib/uttk/strategies/SignalCmd.rb +85 -0
- data/lib/uttk/strategies/Sleep.rb +36 -0
- data/lib/uttk/strategies/SqlQuery.rb +120 -0
- data/lib/uttk/strategies/Strategy.rb +683 -0
- data/lib/uttk/strategies/Stub.rb +37 -0
- data/lib/uttk/strategies/SubCmd.rb +77 -0
- data/lib/uttk/strategies/Suite.rb +71 -0
- data/lib/uttk/strategies/Test.rb +89 -0
- data/lib/uttk/streams.rb +69 -0
- data/lib/uttk/streams/Diff.rb +60 -0
- data/lib/uttk/streams/HexaDiff.rb +35 -0
- data/lib/uttk/streams/Stream.rb +76 -0
- data/lib/uttk/weights.rb +17 -0
- data/lib/uttk/weights/WExpr.rb +68 -0
- data/lib/uttk/weights/WFloat.rb +23 -0
- data/lib/uttk/weights/WMin.rb +22 -0
- data/lib/uttk/weights/Weight.rb +105 -0
- data/lib/www/javascripts/uttk.js +185 -0
- data/misc/expandtab.rb +29 -0
- data/misc/header.rb +44 -0
- data/misc/renaming +57 -0
- data/misc/textile_compiler +194 -0
- data/misc/uttk-grep.sh +8 -0
- data/misc/uttk-line-count.rb +143 -0
- data/test/examples-suite.yml +8 -0
- data/test/examples/README +68 -0
- data/test/examples/basic.rb +10 -0
- data/test/examples/basic.yml +9 -0
- data/test/examples/cache/cache_and_fatal.yml +5 -0
- data/test/examples/cache/simple.yml +30 -0
- data/test/examples/sql/basic.yml +24 -0
- data/test/examples/students-suite.yml +9 -0
- data/test/examples/students/ball.yml +11 -0
- data/test/examples/students/glob_stud.yml +20 -0
- data/test/examples/students/mini-lib.yml +61 -0
- data/test/examples/students/pool_stud.yml +31 -0
- data/test/examples/students/stud.yml +21 -0
- data/test/fixtures/ball/20040804-exam_a1-zapngo-tessar_m.tar.gz +0 -0
- data/test/fixtures/ball/Makefile +24 -0
- data/test/fixtures/ball/bar_p-mini-lib.tar.bz2 +0 -0
- data/test/fixtures/ball/bar_p-mini-lib/Makefile +20 -0
- data/test/fixtures/ball/bar_p-mini-lib/my_strlen.c +13 -0
- data/test/fixtures/ball/foo_s-mini-lib.tar.bz2 +0 -0
- data/test/fixtures/ball/foo_s-mini-lib/Makefile +20 -0
- data/test/fixtures/ball/foo_s-mini-lib/configure +2 -0
- data/test/fixtures/ball/foo_s-mini-lib/my_strlen.c +10 -0
- data/test/fixtures/ball/hello.tar.bz2 +0 -0
- data/test/fixtures/ball/hello.tar.gz +0 -0
- data/test/fixtures/ball/hello/Makefile +14 -0
- data/test/fixtures/ball/hello/hello.c +7 -0
- data/test/fixtures/ball/jack-exit.tar.bz2 +0 -0
- data/test/fixtures/ball/jack-exit/Makefile +14 -0
- data/test/fixtures/ball/jack-exit/exit.c +16 -0
- data/test/fixtures/ball/joe-exit.tar.bz2 +0 -0
- data/test/fixtures/ball/joe-exit/Makefile +14 -0
- data/test/fixtures/ball/joe-exit/exit.c +8 -0
- data/test/fixtures/ball/joe_i-mini-lib.tar.bz2 +0 -0
- data/test/fixtures/ball/joe_i-mini-lib/Makefile +20 -0
- data/test/fixtures/ball/joe_i-mini-lib/configure +2 -0
- data/test/fixtures/ball/joe_i-mini-lib/my_strlen.c +10 -0
- data/test/fixtures/ball/john-exit.tar.bz2 +0 -0
- data/test/fixtures/ball/john-exit/Makefile +14 -0
- data/test/fixtures/ball/john-exit/exit.c +6 -0
- data/test/fixtures/ball/qux_j-mini-lib.tar.bz2 +0 -0
- data/test/fixtures/ball/qux_j-mini-lib/Makefile +20 -0
- data/test/fixtures/ball/qux_j-mini-lib/my_strlen.c +12 -0
- data/test/fixtures/binaries/segv +0 -0
- data/test/fixtures/binaries/segv.c +10 -0
- data/test/fixtures/binaries/segv.rb +2 -0
- data/test/fixtures/demo/command-tutorial/steps/1/check.yml +5 -0
- data/test/fixtures/demo/command-tutorial/steps/1/pluralizer.rb +10 -0
- data/test/fixtures/demo/command-tutorial/steps/2/bad_check.yml +7 -0
- data/test/fixtures/demo/command-tutorial/steps/2/check.yml +7 -0
- data/test/fixtures/demo/command-tutorial/steps/2/pluralizer.rb +10 -0
- data/test/fixtures/demo/command-tutorial/steps/3.1/check.yml +12 -0
- data/test/fixtures/demo/command-tutorial/steps/3/check.yml +14 -0
- data/test/fixtures/demo/command-tutorial/steps/4.1/bird.txt +1 -0
- data/test/fixtures/demo/command-tutorial/steps/4.1/check.yml +12 -0
- data/test/fixtures/demo/command-tutorial/steps/4/check.yml +12 -0
- data/test/fixtures/demo/command-tutorial/steps/4/pluralizer.rb +12 -0
- data/test/fixtures/demo/command-tutorial/steps/5.1/bird.txt +1 -0
- data/test/fixtures/demo/command-tutorial/steps/5.1/check.yml +17 -0
- data/test/fixtures/demo/command-tutorial/steps/5.1/pluralizer.rb +17 -0
- data/test/fixtures/demo/command-tutorial/steps/5/bird.txt +1 -0
- data/test/fixtures/demo/command-tutorial/steps/5/check.yml +16 -0
- data/test/fixtures/demo/command-tutorial/steps/5/pluralizer.rb +16 -0
- data/test/fixtures/demo/command-tutorial/steps/6.1/bird.txt +1 -0
- data/test/fixtures/demo/command-tutorial/steps/6.1/check.yml +22 -0
- data/test/fixtures/demo/command-tutorial/steps/6.1/pluralizer.rb +17 -0
- data/test/fixtures/demo/command-tutorial/steps/6/bird.txt +1 -0
- data/test/fixtures/demo/command-tutorial/steps/6/check.yml +21 -0
- data/test/fixtures/demo/command-tutorial/steps/6/pluralizer.rb +17 -0
- data/test/fixtures/demo/command-tutorial/steps/7/bird.txt +1 -0
- data/test/fixtures/demo/command-tutorial/steps/7/check.yml +22 -0
- data/test/fixtures/demo/command-tutorial/steps/7/pluralizer.rb +17 -0
- data/test/fixtures/demo/filter-tutorial/check.yml +20 -0
- data/test/fixtures/demo/filter-tutorial/filters/CutSkip100.rb +19 -0
- data/test/fixtures/demo/filter-tutorial/pluralizer.rb +17 -0
- data/test/fixtures/java/unit/MultiRight/Foo/Foo.java +11 -0
- data/test/fixtures/java/unit/MultiRight/Foo/FooTest.java +15 -0
- data/test/fixtures/java/unit/MultiRight/MultiRight.java +13 -0
- data/test/fixtures/java/unit/MultiRight/MultiRightTest.java +12 -0
- data/test/fixtures/java/unit/MultiRight/bar/Bar.java +11 -0
- data/test/fixtures/java/unit/MultiRight/bar/BarTest.java +21 -0
- data/test/fixtures/java/unit/MultiRight/build.sh +7 -0
- data/test/fixtures/java/unit/SimpleException/SimpleExceptionTest.java +11 -0
- data/test/fixtures/java/unit/SimpleException/build.sh +4 -0
- data/test/fixtures/java/unit/build.sh +9 -0
- data/test/fixtures/java/unit/multibar.yml +6 -0
- data/test/fixtures/java/unit/multifoo.yml +6 -0
- data/test/fixtures/java/unit/multiright.yml +8 -0
- data/test/fixtures/java/unit/simple_exception.yml +6 -0
- data/test/fixtures/mini-lib/Makefile +9 -0
- data/test/fixtures/mini-lib/strlen.c +15 -0
- data/test/fixtures/package/pkg_foo.tar.gz +0 -0
- data/test/fixtures/package/pkg_foo/Makefile +20 -0
- data/test/fixtures/package/pkg_foo/bootstrap +3 -0
- data/test/fixtures/package/pkg_foo/configure +3 -0
- data/test/fixtures/package/pkg_foo/foo.sh +2 -0
- data/test/fixtures/text/1.txt +4 -0
- data/test/fixtures/unit/bad.rb +26 -0
- data/test/fixtures/unit/error.rb +6 -0
- data/test/fixtures/unit/good.rb +26 -0
- data/test/functional-suite.yml +10 -0
- data/test/functional/author.yml +11 -0
- data/test/functional/base.yml +119 -0
- data/test/functional/base_pool.yml +13 -0
- data/test/functional/block.yml +13 -0
- data/test/functional/cat.yml +16 -0
- data/test/functional/cmd.yml +17 -0
- data/test/functional/diff.yml +27 -0
- data/test/functional/env_cmd.yml +53 -0
- data/test/functional/exit.yml +15 -0
- data/test/functional/fatal.yml +23 -0
- data/test/functional/glob.yml +11 -0
- data/test/functional/hexa-diff.yml +25 -0
- data/test/functional/import.yml +41 -0
- data/test/functional/iterate.yml +99 -0
- data/test/functional/killall.yml +31 -0
- data/test/functional/pkg.yml +14 -0
- data/test/functional/probability_threshold.yml +35 -0
- data/test/functional/r_unit.yml +26 -0
- data/test/functional/rmatch.yml +122 -0
- data/test/functional/signal_cmd.yml +22 -0
- data/test/functional/sub.yml +15 -0
- data/test/functional/test.yml +25 -0
- data/test/functional/timeout.yml +20 -0
- data/test/functional/wc.yml +26 -0
- data/test/functional/weight.yml +152 -0
- data/test/pkg-suite.yml +8 -0
- data/test/pkg/cmdline.yml +80 -0
- data/test/pool-suite.yml +8 -0
- data/test/pool/base.yml +12 -0
- data/test/pool/pool.yml +25 -0
- data/test/ruby-suite.rb +10 -0
- data/test/ruby-suite.yml +5 -0
- data/test/ruby/base.rb +119 -0
- data/test/ruby/iterate.rb +21 -0
- data/test/ruby/wc.rb +43 -0
- data/test/unit-suite.yml +10 -0
- data/test/unit/dumpers/path_test.rb +46 -0
- data/test/unit/dumpers/xml_test.rb +65 -0
- data/test/unit/dumpers/yaml_test.rb +65 -0
- data/test/unit/filters/buffer_test.rb +168 -0
- data/test/unit/filters/keep_skip_based_test.rb +46 -0
- data/test/unit/filters/node_cut_test.rb +72 -0
- data/test/unit/filters/rpath_filter_test.rb +191 -0
- data/test/unit/filters/text_filter_test.rb +46 -0
- data/test/unit/filters_test.rb +119 -0
- data/test/unit/logger/section_node_test.rb +120 -0
- data/test/unit/logger/severity_test.rb +37 -0
- data/test/unit/logger/to_uttk_log_test.rb +113 -0
- data/test/unit/logger/verbosity_test.rb +44 -0
- data/test/unit/logger_test.rb +203 -0
- data/test/unit/strategies/suite_test.rb +151 -0
- data/test/uttk-check.yml +8 -0
- data/test/uttk-distcheck.yml +18 -0
- metadata +399 -0
data/test/ruby/wc.rb
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
S::Suite.new 'Test the wc command (wc.rb)' do
|
|
3
|
+
|
|
4
|
+
attributes do
|
|
5
|
+
strategy S::Cmd
|
|
6
|
+
command 'wc -c'
|
|
7
|
+
self.exit 0 # Must use self otherwise it is Kernel.exit
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
contents do
|
|
11
|
+
|
|
12
|
+
name 'good foo' do
|
|
13
|
+
input 'foo'
|
|
14
|
+
output(/\s*3\n$/)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
name 'bad foo' do
|
|
18
|
+
input 'foo'
|
|
19
|
+
output(/\s*4\n$/)
|
|
20
|
+
weight(-1)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
name 'good foo foo' do
|
|
24
|
+
input "foo\n foo"
|
|
25
|
+
output(/\s*8\n$/)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
name 'useless foo' do
|
|
29
|
+
input "foo"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
name 'from file test' do
|
|
33
|
+
input Pathname.new('<<pwd>>/../fixtures/text/1.txt')
|
|
34
|
+
output(/\s*272\n$/)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
data/test/unit-suite.yml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
|
|
2
|
+
# Copyright:: Copyright (c) 2005 Uttk Team. All rights reserved.
|
|
3
|
+
# License:: LGPL
|
|
4
|
+
# Revision:: $Id: /w/fey/uttk/trunk/test/unit/dumpers/path_test.rb 21844 2006-02-17T17:26:59.771162Z pouillar $
|
|
5
|
+
|
|
6
|
+
test_section __FILE__ do
|
|
7
|
+
|
|
8
|
+
module Uttk
|
|
9
|
+
|
|
10
|
+
module Dumpers
|
|
11
|
+
|
|
12
|
+
class PathTest < ::Test::Unit::TestCase
|
|
13
|
+
|
|
14
|
+
#
|
|
15
|
+
# Methods
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
def setup
|
|
19
|
+
super
|
|
20
|
+
# ...
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def teardown
|
|
24
|
+
super
|
|
25
|
+
# ...
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
#
|
|
29
|
+
# Tests
|
|
30
|
+
#
|
|
31
|
+
|
|
32
|
+
def test_xxx
|
|
33
|
+
# ...
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def test_yyy
|
|
37
|
+
# ...
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end # class PathTest
|
|
41
|
+
|
|
42
|
+
end # module Dumpers
|
|
43
|
+
|
|
44
|
+
end # module Uttk
|
|
45
|
+
|
|
46
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
|
|
2
|
+
# Copyright:: Copyright (c) 2004, 2005 Uttk Team. All rights reserved.
|
|
3
|
+
# License:: LGPL
|
|
4
|
+
# Revision:: $Id: /w/fey/uttk/trunk/test/unit/dumpers/xml_test.rb 21975 2006-02-19T22:24:11.182512Z pouillar $
|
|
5
|
+
|
|
6
|
+
test_section __FILE__ do
|
|
7
|
+
|
|
8
|
+
module Uttk
|
|
9
|
+
|
|
10
|
+
module Dumpers
|
|
11
|
+
|
|
12
|
+
class Xml
|
|
13
|
+
|
|
14
|
+
class Test < Test::Unit::TestCase
|
|
15
|
+
|
|
16
|
+
def test_simple
|
|
17
|
+
ref_output = <<-end
|
|
18
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
19
|
+
<node name='root' type='Uttk::Strategies::Suite'>
|
|
20
|
+
<node name='contents'>
|
|
21
|
+
<node name='sub1' type='Uttk::Strategies::Cmd'>
|
|
22
|
+
<node name='foo'>bar</node>
|
|
23
|
+
<node name='test'>
|
|
24
|
+
<node name='subsub'>
|
|
25
|
+
<node name='status'>PASS</node>
|
|
26
|
+
</node>
|
|
27
|
+
</node>
|
|
28
|
+
</node>
|
|
29
|
+
<node name='sub2'>
|
|
30
|
+
<node name='status'>FAILED</node>
|
|
31
|
+
</node>
|
|
32
|
+
</node>
|
|
33
|
+
<node name='status'>1/2</node>
|
|
34
|
+
</node>
|
|
35
|
+
end
|
|
36
|
+
ref_output.gsub!(/^ /, '')
|
|
37
|
+
|
|
38
|
+
TempPath.new do |my_output|
|
|
39
|
+
io = my_output.open('w')
|
|
40
|
+
log = Logger.new(Xml.new(io))
|
|
41
|
+
log.new_node :root, :type => Strategies::Suite do
|
|
42
|
+
log.new_node :contents, :ordered => true do
|
|
43
|
+
log.new_node :sub1, :type => Strategies::Cmd do
|
|
44
|
+
log.foo = :bar
|
|
45
|
+
log.test = { :subsub => { :status => :PASS } }
|
|
46
|
+
end
|
|
47
|
+
log.sub2 = { :status => :FAILED }
|
|
48
|
+
end
|
|
49
|
+
log.status = '1/2'
|
|
50
|
+
end
|
|
51
|
+
log.close
|
|
52
|
+
io.close
|
|
53
|
+
assert_equal(ref_output, my_output.read)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
end # class Test
|
|
58
|
+
|
|
59
|
+
end # class Xml
|
|
60
|
+
|
|
61
|
+
end # module Dumpers
|
|
62
|
+
|
|
63
|
+
end # module Uttk
|
|
64
|
+
|
|
65
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
|
|
2
|
+
# Copyright:: Copyright (c) 2004, 2005 Uttk Team. All rights reserved.
|
|
3
|
+
# License:: LGPL
|
|
4
|
+
# Revision:: $Id: /w/fey/uttk/trunk/test/unit/dumpers/yaml_test.rb 21975 2006-02-19T22:24:11.182512Z pouillar $
|
|
5
|
+
|
|
6
|
+
test_section __FILE__ do
|
|
7
|
+
|
|
8
|
+
module Uttk
|
|
9
|
+
|
|
10
|
+
module Dumpers
|
|
11
|
+
|
|
12
|
+
class Yaml
|
|
13
|
+
|
|
14
|
+
class Test < Test::Unit::TestCase
|
|
15
|
+
|
|
16
|
+
def test_simple
|
|
17
|
+
out_ref = <<-end
|
|
18
|
+
---
|
|
19
|
+
root: !S::Suite
|
|
20
|
+
contents:
|
|
21
|
+
- sub1: !S::Pool
|
|
22
|
+
test:
|
|
23
|
+
subsub:
|
|
24
|
+
status: PASS
|
|
25
|
+
foo: bar
|
|
26
|
+
- sub2:
|
|
27
|
+
status: FAIL
|
|
28
|
+
status: FAIL(50%)
|
|
29
|
+
end
|
|
30
|
+
out_ref.gsub!(/^ /, '')
|
|
31
|
+
|
|
32
|
+
out_my = StringIO.new
|
|
33
|
+
l = Logger.new(Yaml.new(out_my))
|
|
34
|
+
l.new_node :root, :type => Strategies::Suite do
|
|
35
|
+
l.new_node :contents, :ordered => true do
|
|
36
|
+
l.new_node :sub1, :type => Strategies::Pool do
|
|
37
|
+
l.new_node :test do
|
|
38
|
+
l.new_node :subsub do
|
|
39
|
+
l.new_node(:status) { l.new_leaf "PASS" }
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
l.new_node :foo do
|
|
43
|
+
l.new_leaf "bar"
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
l.new_node :sub2 do
|
|
47
|
+
l.new_node(:status) { l.new_leaf "FAIL" }
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
l.new_node(:status) { l.new_leaf "FAIL(50%)" }
|
|
51
|
+
end
|
|
52
|
+
out_my.rewind
|
|
53
|
+
|
|
54
|
+
assert_equal(out_ref, out_my.read)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end # class Yaml
|
|
60
|
+
|
|
61
|
+
end # module Dumpers
|
|
62
|
+
|
|
63
|
+
end # module Uttk
|
|
64
|
+
|
|
65
|
+
end
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Author:: Yannick Lacaute <lacaut_y@epita.fr>
|
|
2
|
+
# Copyright:: Copyright (c) 2004, 2005 Uttk team. All rights reserved.
|
|
3
|
+
# License:: LGPL
|
|
4
|
+
# $Id: Buffer.rb 645 2005-07-11 21:52:01 thor $
|
|
5
|
+
|
|
6
|
+
test_section __FILE__ do
|
|
7
|
+
|
|
8
|
+
module Uttk
|
|
9
|
+
|
|
10
|
+
module Filters
|
|
11
|
+
|
|
12
|
+
class BufferTest < Test::Unit::TestCase
|
|
13
|
+
include Mocks::Assertions
|
|
14
|
+
include Buffer::Assertions
|
|
15
|
+
|
|
16
|
+
@@ordered = { :ordered => true }
|
|
17
|
+
|
|
18
|
+
def get_notifs ( anObject )
|
|
19
|
+
mo = Mocks::Observer.new
|
|
20
|
+
log = Logger.new(mo)
|
|
21
|
+
log << anObject
|
|
22
|
+
mo.mock_args
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def setup
|
|
26
|
+
@notif_one_leaf = [
|
|
27
|
+
[ [], :foo ]
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
@notif_two_leaves = [
|
|
31
|
+
[ [], :foo ],
|
|
32
|
+
[ [], :bar ]
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
@notifs_simple_map = [
|
|
36
|
+
[ [:foo], :bar ]
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
@notifs_simple_omap = [
|
|
40
|
+
[ [[:foo, @@ordered], :bar], :baz ]
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
@complex_tree_with_array =
|
|
44
|
+
{
|
|
45
|
+
:root =>
|
|
46
|
+
{
|
|
47
|
+
:strategy => :cmd,
|
|
48
|
+
:contents =>
|
|
49
|
+
[
|
|
50
|
+
{
|
|
51
|
+
:test1 =>
|
|
52
|
+
{
|
|
53
|
+
:cmd => [:a],
|
|
54
|
+
:exit => [:aa]
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
:test2 =>
|
|
59
|
+
{
|
|
60
|
+
:cmd => :b,
|
|
61
|
+
:exit => :bb
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@complex_tree_with_ohash =
|
|
69
|
+
{
|
|
70
|
+
:root =>
|
|
71
|
+
{
|
|
72
|
+
:strategy => :cmd,
|
|
73
|
+
:contents =>
|
|
74
|
+
OHash[
|
|
75
|
+
:test1, { :cmd => [:a], :exit=> [:aa] },
|
|
76
|
+
:test2, { :cmd => :b, :exit => :bb }
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@notifs_complex_gen_from_ohash = get_notifs(@complex_tree_with_ohash)
|
|
82
|
+
@notifs_complex_gen_from_array = get_notifs(@complex_tree_with_array)
|
|
83
|
+
|
|
84
|
+
@notifs_complex = [
|
|
85
|
+
[ [:root, [:strategy, @@ordered]], :cmd ],
|
|
86
|
+
|
|
87
|
+
[ [:root,[:contents, @@ordered],:test1,[:cmd, @@ordered]], [:a] ],
|
|
88
|
+
[ [:root,[:contents, @@ordered],:test1,[:exit, @@ordered]], [:aa] ],
|
|
89
|
+
|
|
90
|
+
[ [:root,[:contents, @@ordered],:test2,:cmd], :b ],
|
|
91
|
+
[ [:root,[:contents, @@ordered],:test2,:exit], :bb ]
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
@notifs_map_with_two_leaves = [
|
|
95
|
+
[ [:foo], :bar ],
|
|
96
|
+
[ [:foo], :baz ]
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
@notifs_omap_with_two_leaves = [
|
|
100
|
+
[ [[:foo, @@ordered]], :bar ],
|
|
101
|
+
[ [[:foo, @@ordered]], :baz ]
|
|
102
|
+
]
|
|
103
|
+
|
|
104
|
+
self.mock_object = Mocks::Observer.new
|
|
105
|
+
@buffer = Buffer.new([mock_object])
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def inject(notifs)
|
|
109
|
+
notifs.each do |n|
|
|
110
|
+
@buffer.update(*Logger.make_notif(n))
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def test_buffer_one_leaf
|
|
115
|
+
inject @notif_one_leaf
|
|
116
|
+
assert_buffer :foo
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def test_buffer_two_leaves
|
|
120
|
+
inject @notif_two_leaves
|
|
121
|
+
assert_buffer :bar
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def test_buffer_simple_map
|
|
125
|
+
inject @notifs_simple_map
|
|
126
|
+
assert_buffer :foo => :bar
|
|
127
|
+
assert_not_buffer :foo => { :wrong_value => nil }
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def test_buffer_simple_omap
|
|
131
|
+
inject @notifs_simple_omap
|
|
132
|
+
assert_buffer :foo => OHash[:bar, :baz]
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def test_buffer_complex
|
|
136
|
+
inject @notifs_complex
|
|
137
|
+
assert_buffer @complex_tree_with_ohash
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def test_buffer_complex_from_ohash
|
|
141
|
+
inject @notifs_complex_gen_from_ohash
|
|
142
|
+
assert_buffer @complex_tree_with_ohash
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def test_buffer_complex_from_array
|
|
146
|
+
inject @notifs_complex_gen_from_array
|
|
147
|
+
assert_buffer @complex_tree_with_ohash
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def test_buffer_map_with_two_leaves
|
|
151
|
+
assert_raise(Logger::DuplicatedPath) { inject @notifs_map_with_two_leaves }
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def test_buffer_omap_with_two_leaves
|
|
155
|
+
inject @notifs_omap_with_two_leaves
|
|
156
|
+
assert_buffer :foo => [
|
|
157
|
+
:bar,
|
|
158
|
+
:baz
|
|
159
|
+
]
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
end # class BufferTest
|
|
163
|
+
|
|
164
|
+
end # module Filters
|
|
165
|
+
|
|
166
|
+
end # module Uttk
|
|
167
|
+
|
|
168
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
|
|
2
|
+
# Copyright:: Copyright (c) 2005 Uttk Team. All rights reserved.
|
|
3
|
+
# License:: LGPL
|
|
4
|
+
# Revision:: $Id: /fey/uttk/trunk/test/unit/filters/keep_skip_based_test.rb 8778 2005-09-26T04:34:48.103938Z ertai $
|
|
5
|
+
|
|
6
|
+
test_section __FILE__ do
|
|
7
|
+
|
|
8
|
+
module Uttk
|
|
9
|
+
|
|
10
|
+
module Filters
|
|
11
|
+
|
|
12
|
+
class KeepSkipBasedTest < ::Test::Unit::TestCase
|
|
13
|
+
|
|
14
|
+
#
|
|
15
|
+
# Methods
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
def setup
|
|
19
|
+
super
|
|
20
|
+
# ...
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def teardown
|
|
24
|
+
super
|
|
25
|
+
# ...
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
#
|
|
29
|
+
# Tests
|
|
30
|
+
#
|
|
31
|
+
|
|
32
|
+
def test_xxx
|
|
33
|
+
# ...
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def test_yyy
|
|
37
|
+
# ...
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end # class KeepSkipBasedTest
|
|
41
|
+
|
|
42
|
+
end # module Filters
|
|
43
|
+
|
|
44
|
+
end # module Uttk
|
|
45
|
+
|
|
46
|
+
end
|