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
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
Test the weight system: !S::Suite
|
|
4
|
+
contents:
|
|
5
|
+
- All or nothing (0%): !S::RMatch
|
|
6
|
+
test: !S::Suite
|
|
7
|
+
wclass: W::WMin
|
|
8
|
+
contents:
|
|
9
|
+
- Suppose to PASS 1: !S::Pass {}
|
|
10
|
+
- Suppose to PASS 2: !S::Pass {}
|
|
11
|
+
- Suppose to FAIL 3: !S::Fail {}
|
|
12
|
+
match:
|
|
13
|
+
- ///1/status/PASS$
|
|
14
|
+
- ///2/status/PASS$
|
|
15
|
+
- ///3/status/FAIL$
|
|
16
|
+
- //status/FAIL$
|
|
17
|
+
|
|
18
|
+
- All or nothing (100%): !S::RMatch
|
|
19
|
+
test: !S::Suite
|
|
20
|
+
wclass: W::WMin
|
|
21
|
+
contents:
|
|
22
|
+
- Suppose to PASS 4: !S::Pass {}
|
|
23
|
+
- Suppose to FAIL 5: !S::Fail
|
|
24
|
+
weight: -1
|
|
25
|
+
- Suppose to PASS 6: !S::Pass {}
|
|
26
|
+
match:
|
|
27
|
+
- ///4/status/PASS$
|
|
28
|
+
- ///5/status/FAIL$
|
|
29
|
+
- ///6/status/PASS$
|
|
30
|
+
- //status/PASS$
|
|
31
|
+
|
|
32
|
+
- Percentage (70%): !S::RMatch
|
|
33
|
+
test: !S::Suite
|
|
34
|
+
contents:
|
|
35
|
+
- Suppose to PASS 7: !S::Pass {}
|
|
36
|
+
- Suppose to PASS 8: !S::Pass
|
|
37
|
+
weight: 2
|
|
38
|
+
- Sub suite (25%): !S::Suite
|
|
39
|
+
contents:
|
|
40
|
+
- Suppose to PASS 9: !S::Pass {}
|
|
41
|
+
- Suppose to FAIL 10: !S::Fail
|
|
42
|
+
weight: 2
|
|
43
|
+
- Suppose to FAIL 11: !S::Fail {}
|
|
44
|
+
- Suppose to FAIL 12: !S::Fail {}
|
|
45
|
+
- Suppose to PASS 13: !S::Pass {}
|
|
46
|
+
match:
|
|
47
|
+
- ///7/status/PASS$
|
|
48
|
+
- ///8/status/PASS$
|
|
49
|
+
- ///Sub//9/status/PASS$
|
|
50
|
+
- ///Sub//10/status/FAIL$
|
|
51
|
+
- ///Sub//11/status/FAIL$
|
|
52
|
+
- ///Sub/status/FAIL\(25%\)$
|
|
53
|
+
- //status/FAIL\(70%\)$
|
|
54
|
+
|
|
55
|
+
- Fatal pass (100%): !S::RMatch
|
|
56
|
+
test: !S::Suite
|
|
57
|
+
attributes: !S::Pass {}
|
|
58
|
+
contents:
|
|
59
|
+
- Suppose to PASS 14:
|
|
60
|
+
fatal: true
|
|
61
|
+
- Suppose to PASS 15: {}
|
|
62
|
+
match:
|
|
63
|
+
- ///14/status/PASS$
|
|
64
|
+
- ///15/status/PASS$
|
|
65
|
+
- //status/PASS$
|
|
66
|
+
|
|
67
|
+
- Fatal fail (20%): !S::RMatch
|
|
68
|
+
test: !S::Suite
|
|
69
|
+
contents:
|
|
70
|
+
- Suppose to PASS 15.5: !S::Pass
|
|
71
|
+
fatal: true
|
|
72
|
+
- Suppose to FAIL 16: !S::Fail
|
|
73
|
+
fatal: true
|
|
74
|
+
- Suppose to be not tested 17: !S::Pass {}
|
|
75
|
+
- Suppose to be not tested 17.5: !S::Fail
|
|
76
|
+
weight: 2
|
|
77
|
+
match:
|
|
78
|
+
- ///15.5/status/PASS$
|
|
79
|
+
- ///16/status/FAIL$
|
|
80
|
+
- //status/FAIL\(20%\)$
|
|
81
|
+
dont_match:
|
|
82
|
+
- ///17
|
|
83
|
+
|
|
84
|
+
- Fatal pass but other fail (50%): !S::RMatch
|
|
85
|
+
test: !S::Suite
|
|
86
|
+
contents:
|
|
87
|
+
- Suppose to PASS 18: !S::Pass
|
|
88
|
+
fatal: true
|
|
89
|
+
- Suppose to FAIL 19: !S::Fail {}
|
|
90
|
+
match:
|
|
91
|
+
- ///18/status/PASS$
|
|
92
|
+
- ///19/status/FAIL$
|
|
93
|
+
- //status/FAIL\(50%\)$
|
|
94
|
+
|
|
95
|
+
- Fatal pass but no weight (100%): !S::RMatch
|
|
96
|
+
test: !S::Suite
|
|
97
|
+
attributes: !S::Pass {}
|
|
98
|
+
contents:
|
|
99
|
+
- Suppose to PASS 20:
|
|
100
|
+
weight: 0
|
|
101
|
+
fatal: true
|
|
102
|
+
- Suppose to PASS 21: {}
|
|
103
|
+
- Suppose to PASS 22: {}
|
|
104
|
+
match:
|
|
105
|
+
- ///20/status/PASS$
|
|
106
|
+
- ///21/status/PASS$
|
|
107
|
+
- ///22/status/PASS$
|
|
108
|
+
- //status/PASS$
|
|
109
|
+
|
|
110
|
+
- Fatal fail but no weight (0%): !S::RMatch
|
|
111
|
+
test: !S::Suite
|
|
112
|
+
attributes: !S::Pass {}
|
|
113
|
+
contents:
|
|
114
|
+
- Suppose to FAIL 23: !S::Fail
|
|
115
|
+
weight: 0
|
|
116
|
+
fatal: true
|
|
117
|
+
- Suppose to be not tested 24: {}
|
|
118
|
+
- Suppose to be not tested 25: {}
|
|
119
|
+
match:
|
|
120
|
+
- ///23/status/FAIL$
|
|
121
|
+
- //status/FAIL$
|
|
122
|
+
dont_match:
|
|
123
|
+
- ///24
|
|
124
|
+
- ///25
|
|
125
|
+
|
|
126
|
+
- Negative (66%): !S::RMatch
|
|
127
|
+
test: !S::Suite
|
|
128
|
+
attributes: !S::Pass {}
|
|
129
|
+
contents:
|
|
130
|
+
- Suppose to PASS 26: {}
|
|
131
|
+
- Suppose to PASS 27:
|
|
132
|
+
weight: -1
|
|
133
|
+
- Suppose to PASS 28: {}
|
|
134
|
+
match:
|
|
135
|
+
- ///26/status/PASS$
|
|
136
|
+
- ///27/status/PASS$
|
|
137
|
+
- ///28/status/PASS$
|
|
138
|
+
- //status/FAIL\(66%\)$
|
|
139
|
+
|
|
140
|
+
- Negative (100%): !S::RMatch
|
|
141
|
+
test: !S::Suite
|
|
142
|
+
attributes: !S::Pass {}
|
|
143
|
+
contents:
|
|
144
|
+
- Suppose to PASS 29: {}
|
|
145
|
+
- Suppose to PASS 30: !S::Fail
|
|
146
|
+
weight: -1
|
|
147
|
+
- Suppose to PASS 31: {}
|
|
148
|
+
match:
|
|
149
|
+
- ///29/status/PASS$
|
|
150
|
+
- ///30/status/FAIL$
|
|
151
|
+
- ///31/status/PASS$
|
|
152
|
+
- //status/PASS$
|
data/test/pkg-suite.yml
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
Tests for command line Uttk options: !S::Suite
|
|
4
|
+
attributes: !S::Cmd
|
|
5
|
+
command : <<uttk>>
|
|
6
|
+
error : ""
|
|
7
|
+
exit : 0
|
|
8
|
+
contents:
|
|
9
|
+
- version:
|
|
10
|
+
args: --version
|
|
11
|
+
output: !re |
|
|
12
|
+
Uttk version \d+\.\d+ \{.*\} \[\w+\]
|
|
13
|
+
|
|
14
|
+
Copyright \(c\) 2004(?:, \d+)* Nicolas Despr�s, Nicolas Pouillard
|
|
15
|
+
This is free software; see the source for copying conditions\. There is NO
|
|
16
|
+
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\.
|
|
17
|
+
|
|
18
|
+
- authors:
|
|
19
|
+
args: --authors
|
|
20
|
+
output: !re |
|
|
21
|
+
---
|
|
22
|
+
Uttk was written by and with the assistance of:(\n|.)*
|
|
23
|
+
- Vincent Cuissard.*:(\n|.)*
|
|
24
|
+
- Nicolas Despr�s.*:(\n|.)*
|
|
25
|
+
- Nicolas Pouillard.*:(\n|.)*
|
|
26
|
+
|
|
27
|
+
- help:
|
|
28
|
+
args: --help
|
|
29
|
+
output: !re [^---\nUsage.*Team, m]
|
|
30
|
+
|
|
31
|
+
- long help:
|
|
32
|
+
args: --long-help
|
|
33
|
+
output: !re [^---\nUsage.*Strategy options.*Team, m]
|
|
34
|
+
|
|
35
|
+
- long help on Strategy:
|
|
36
|
+
args: --long-help Strategy
|
|
37
|
+
output: !re [^Uttk::Strategies::Strategy:.*name:, m]
|
|
38
|
+
|
|
39
|
+
- unknown option:
|
|
40
|
+
args: --this-option-does-not-exists
|
|
41
|
+
error: |
|
|
42
|
+
ERROR:
|
|
43
|
+
invalid option: --this-option-does-not-exists (OptionParser)
|
|
44
|
+
exit: 1
|
|
45
|
+
|
|
46
|
+
- Strategy list:
|
|
47
|
+
args: --strategy-list
|
|
48
|
+
output: !re |
|
|
49
|
+
^Uttk::Strategies classes hierarchy:
|
|
50
|
+
/Strategy/
|
|
51
|
+
|
|
52
|
+
- Loader list:
|
|
53
|
+
args: -L
|
|
54
|
+
output: !re |
|
|
55
|
+
^Uttk::Loaders classes hierarchy:
|
|
56
|
+
/Loader/
|
|
57
|
+
|
|
58
|
+
- Filter list:
|
|
59
|
+
args: -F
|
|
60
|
+
output: !re |
|
|
61
|
+
^Uttk::Logger classes hierarchy:
|
|
62
|
+
/Backend/
|
|
63
|
+
|
|
64
|
+
- Symbol option:
|
|
65
|
+
args: |
|
|
66
|
+
-L Ruby -F Yaml -S '{ foo: bar }'
|
|
67
|
+
input: |
|
|
68
|
+
S::Stub.new("stub") do
|
|
69
|
+
returned_value({ :foo => "<<foo>>" })
|
|
70
|
+
end
|
|
71
|
+
output: |
|
|
72
|
+
---
|
|
73
|
+
root: !S::Suite
|
|
74
|
+
symbols:
|
|
75
|
+
foo: bar
|
|
76
|
+
contents:
|
|
77
|
+
- stub: !S::Stub
|
|
78
|
+
foo: bar
|
|
79
|
+
status: PASS
|
|
80
|
+
status: PASS
|
data/test/pool-suite.yml
ADDED
data/test/pool/base.yml
ADDED
data/test/pool/pool.yml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Can be non deterministic if the system takes more than 2 second to kill all
|
|
2
|
+
# the processes. In such a case the summary is 66%.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Test The Pool Feature (pool.yml): !S::Suite
|
|
6
|
+
attributes: !S::Pool
|
|
7
|
+
attributes: !S::Cmd
|
|
8
|
+
command: sleep
|
|
9
|
+
args: 2
|
|
10
|
+
contents: [ a, b, c, d, e, { f: { args: 1 } }, g, h, i, j, k, l, m, n ]
|
|
11
|
+
contents:
|
|
12
|
+
|
|
13
|
+
- I am suppose to PASS:
|
|
14
|
+
timeout: 6
|
|
15
|
+
|
|
16
|
+
- I am suppose to ABORT:
|
|
17
|
+
timeout: 0.1
|
|
18
|
+
weight: -1
|
|
19
|
+
|
|
20
|
+
- I am suppose to ABORT but with some PASS:
|
|
21
|
+
timeout: 1.9
|
|
22
|
+
weight: -1
|
|
23
|
+
|
|
24
|
+
- Zombie Verification Killall: !S::KillAll
|
|
25
|
+
regexp: !re sleep
|
data/test/ruby-suite.rb
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
S::Iterate.new 'Uttk Ruby loader functional test suite' do
|
|
3
|
+
over PathList['<<pwd>>/ruby/(*.rb)']
|
|
4
|
+
iter ['path', 'basename']
|
|
5
|
+
# FIXME make the non hash version works
|
|
6
|
+
# test do
|
|
7
|
+
# S::Import.new("Test <<basename>>") { import '<<path>>' }
|
|
8
|
+
# end
|
|
9
|
+
test(S::Import.new("Test <<basename>>") { import '<<path>>' })
|
|
10
|
+
end
|
data/test/ruby-suite.yml
ADDED
data/test/ruby/base.rb
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
|
|
2
|
+
# You are in the context of the Uttk module.
|
|
3
|
+
# You can access the table of symbols with this local variable: symtbl.
|
|
4
|
+
|
|
5
|
+
# You can factorize some code this way:
|
|
6
|
+
def self.check_for_zombies
|
|
7
|
+
S::KillAll.new('check for zombies') do
|
|
8
|
+
regexp(/sleep/)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
S::Suite.new('Test the basic features of Strategy and Suite (base.rb)') do
|
|
14
|
+
contents [
|
|
15
|
+
S::Pass.new('pass'),
|
|
16
|
+
S::Fail.new('fail') { weight(-1) },
|
|
17
|
+
S::Error.new('error') { weight(-1) },
|
|
18
|
+
S::Stub.new('stub') {
|
|
19
|
+
returned_value 'foo' => 'bar', 'toto' => 'tata'
|
|
20
|
+
},
|
|
21
|
+
S::Abort.new('abort') { weight(-1) },
|
|
22
|
+
S::Sleep.new('timeout_strategy') {
|
|
23
|
+
delay 0.5
|
|
24
|
+
timeout 0.2
|
|
25
|
+
weight(-1)
|
|
26
|
+
},
|
|
27
|
+
S::Suite.new('timeout_suite') {
|
|
28
|
+
timeout 0.3
|
|
29
|
+
weight(-1)
|
|
30
|
+
attributes :strategy => S::Sleep, :delay => 0.1
|
|
31
|
+
contents [ 'a', 'b', 'c', 'd' ]
|
|
32
|
+
},
|
|
33
|
+
S::Pool.new('timeout_pool') do
|
|
34
|
+
weight(-1)
|
|
35
|
+
timeout 0.3
|
|
36
|
+
attributes({
|
|
37
|
+
:strategy => S::Sleep,
|
|
38
|
+
:delay => 0.4
|
|
39
|
+
})
|
|
40
|
+
contents %w(a b c d)
|
|
41
|
+
end,
|
|
42
|
+
S::Cmd.new('cmd') do
|
|
43
|
+
command 'true'
|
|
44
|
+
exit 0
|
|
45
|
+
end,
|
|
46
|
+
S::Cmd.new('bad cmd') do
|
|
47
|
+
weight(-1)
|
|
48
|
+
command '/bin/unexisting_command'
|
|
49
|
+
exit 0
|
|
50
|
+
end,
|
|
51
|
+
S::Suite.new('abort cmd') do
|
|
52
|
+
contents [
|
|
53
|
+
S::Cmd.new('cmd') {
|
|
54
|
+
weight(-1)
|
|
55
|
+
timeout 0.1
|
|
56
|
+
command 'sleep'
|
|
57
|
+
args 1
|
|
58
|
+
},
|
|
59
|
+
Uttk.check_for_zombies
|
|
60
|
+
]
|
|
61
|
+
end,
|
|
62
|
+
S::Suite.new('abort suite cmd') do
|
|
63
|
+
contents [
|
|
64
|
+
S::Suite.new('suite') {
|
|
65
|
+
weight(-1)
|
|
66
|
+
timeout 0.1
|
|
67
|
+
contents [
|
|
68
|
+
S::Cmd.new('cmd') {
|
|
69
|
+
command 'sleep'
|
|
70
|
+
args 1
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
Uttk.check_for_zombies
|
|
75
|
+
]
|
|
76
|
+
end,
|
|
77
|
+
S::Suite.new('timeout suite of suite') do
|
|
78
|
+
weight(-1)
|
|
79
|
+
timeout { 0.01 } # May use a block too
|
|
80
|
+
contents [
|
|
81
|
+
S::Suite.new('suite') {
|
|
82
|
+
contents [ S::Sleep.new('pass') { delay 0.1 } ]
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
end,
|
|
86
|
+
# Must create a block for {pre,post}_assertion otherwise it is not evaluate
|
|
87
|
+
# at runtime but at creation time.
|
|
88
|
+
S::Pass.new('true pre assertion and pass') do
|
|
89
|
+
pre_assertion lambda { true }
|
|
90
|
+
end,
|
|
91
|
+
S::Fail.new('true pre assertion and fail') do
|
|
92
|
+
weight(-1)
|
|
93
|
+
pre_assertion Proc.new { true }
|
|
94
|
+
end,
|
|
95
|
+
S::Pass.new('false pre assertion and pass') do
|
|
96
|
+
weight(-1)
|
|
97
|
+
pre_assertion proc { false }
|
|
98
|
+
end,
|
|
99
|
+
S::Pass.new('exception pre assertion and pass') do
|
|
100
|
+
weight(-1)
|
|
101
|
+
pre_assertion proc { raise 'ASSERT' }
|
|
102
|
+
end,
|
|
103
|
+
S::Pass.new('true post assertion and pass') do
|
|
104
|
+
post_assertion proc { true }
|
|
105
|
+
end,
|
|
106
|
+
S::Fail.new('true post assertion and fail') do
|
|
107
|
+
weight { -1 }
|
|
108
|
+
post_assertion proc { true }
|
|
109
|
+
end,
|
|
110
|
+
S::Pass.new('false post assertion and pass') do
|
|
111
|
+
weight { -1 }
|
|
112
|
+
post_assertion proc { false }
|
|
113
|
+
end,
|
|
114
|
+
S::Pass.new('exception post assertion and pass') do
|
|
115
|
+
weight { -1 }
|
|
116
|
+
post_assertion proc { raise 'ASSERT' }
|
|
117
|
+
end
|
|
118
|
+
]
|
|
119
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
S::Suite.new 'Test the Iterate strategy (Ruby Loader)' do
|
|
2
|
+
contents [
|
|
3
|
+
S::Iterate.new('Iterate over a range of S::Pass') {
|
|
4
|
+
over 0...4
|
|
5
|
+
with :each
|
|
6
|
+
iter :it
|
|
7
|
+
test S::Pass.new('<<it>>')
|
|
8
|
+
},
|
|
9
|
+
S::Iterate.new('Iterate over a range of S::Assert') {
|
|
10
|
+
over 0...4
|
|
11
|
+
with :each
|
|
12
|
+
iter :it
|
|
13
|
+
test(S::Assert.new('Test on turn <<it>>') {
|
|
14
|
+
test("
|
|
15
|
+
assert_equal('<<it>>', '<<it:i>>')
|
|
16
|
+
assert_equal('<<it>>', '<<it:0>>')
|
|
17
|
+
")
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
end
|