rutema 2.0.0.pre12 → 2.0.0.pre13
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 +4 -4
- data/History.txt +3 -0
- data/lib/rutema/application.rb +5 -5
- data/lib/rutema/core/configuration.rb +17 -5
- data/lib/rutema/core/engine.rb +23 -15
- data/lib/rutema/parsers/xml.rb +4 -2
- data/lib/rutema/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d03b39f53bd09ff213e24af85abece9d729be911
|
4
|
+
data.tar.gz: fc017df49477b0f267dc544e18116605c7fb6291
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11c77f71efc98b3b4a989702df73450988b560d8de4409f748b1134ffa20783bb1b47c5506d54deadef72a2c58a6c8977ca442edb8984b3aa5dbddd64874b67a
|
7
|
+
data.tar.gz: 3b49add79d0e2fa3665a0416fd7f6fea95f6c64e775a00284e3cfd2742b47895896a12e0fb1772c9f81fa5e2a16ba7fbc5c56236f0efe358e339aaa4b4728800
|
data/History.txt
CHANGED
data/lib/rutema/application.rb
CHANGED
@@ -24,7 +24,7 @@ module Rutema
|
|
24
24
|
opt.on("rutema v#{Version::STRING}")
|
25
25
|
opt.on("Options:")
|
26
26
|
opt.on("--config FILE", "-c FILE",String,"Loads the configuration from FILE") { |config_file| @config_file=config_file}
|
27
|
-
opt.on("--check","Runs just the
|
27
|
+
opt.on("--check","Runs just the suite setup test"){@check=true}
|
28
28
|
#opt.on("--step","Runs test cases step by step"){@step=true}
|
29
29
|
opt.on("--silent","Suppresses console output (only for the default reporters)") { @silent=true}
|
30
30
|
opt.on("--bare","No default reporters whatsoever") { @bare=true}
|
@@ -47,11 +47,11 @@ module Rutema
|
|
47
47
|
end
|
48
48
|
def application_flow
|
49
49
|
if @check
|
50
|
-
#run just the
|
51
|
-
if @configuration.
|
52
|
-
exit @engine.run(@configuration.
|
50
|
+
#run just the suite setup test
|
51
|
+
if @configuration.suite_setup
|
52
|
+
exit @engine.run(@configuration.suite_setup)
|
53
53
|
else
|
54
|
-
raise Rutema::RutemaError,"There is no
|
54
|
+
raise Rutema::RutemaError,"There is no suite setup test defined in the configuration."
|
55
55
|
end
|
56
56
|
else
|
57
57
|
#run everything
|
@@ -14,7 +14,7 @@
|
|
14
14
|
# configuration.parser={:class=>Rutema::MinimalXMLParser}
|
15
15
|
# configuration.tests=FileList['all/of/the/tests/**/*.*']
|
16
16
|
module ConfigurationDirectives
|
17
|
-
attr_reader :parser,:runner,:tools,:paths,:tests,:context,:
|
17
|
+
attr_reader :parser,:runner,:tools,:paths,:tests,:context,:setup,:teardown,:suite_setup,:suite_teardown
|
18
18
|
attr_accessor :reporters
|
19
19
|
#Adds a hash of values to the tools hash of the configuration
|
20
20
|
#
|
@@ -62,15 +62,27 @@
|
|
62
62
|
@teardown=check_path(path)
|
63
63
|
end
|
64
64
|
|
65
|
-
#Path to the
|
65
|
+
#Path to the suite setup specification. (optional)
|
66
66
|
#
|
67
|
-
#The
|
67
|
+
#The suite setup test runs once in the beginning of a test run before all the tests.
|
68
68
|
#
|
69
69
|
#If it fails no tests are run.
|
70
|
-
|
71
|
-
|
70
|
+
#
|
71
|
+
#This is also aliased as check= for backwards compatibility
|
72
|
+
def suite_setup= path
|
73
|
+
@suite_setup=check_path(path)
|
72
74
|
end
|
75
|
+
|
76
|
+
alias_method :check,:suite_setup
|
77
|
+
alias_method :check=,:suite_setup=
|
73
78
|
|
79
|
+
#Path to the suite teardown specification. (optional)
|
80
|
+
#
|
81
|
+
#The suite teardown test runs after all the tests.
|
82
|
+
def suite_teardown= path
|
83
|
+
@suite_teardown=check_path(path)
|
84
|
+
end
|
85
|
+
|
74
86
|
#Hash values for passing data to the system. It's supposed to be used in the reporters and contain
|
75
87
|
#values such as version numbers, tester names etc.
|
76
88
|
def context= definition
|
data/lib/rutema/core/engine.rb
CHANGED
@@ -28,10 +28,10 @@ module Rutema
|
|
28
28
|
@dispatcher.run!
|
29
29
|
#start
|
30
30
|
message("start")
|
31
|
-
|
31
|
+
suite_setup,suite_teardown,setup,teardown,tests=*parse(test_identifier)
|
32
32
|
if tests.empty?
|
33
|
-
if is_special?(test_identifier)
|
34
|
-
run_scenarios([
|
33
|
+
if test_identifier && is_special?(test_identifier)
|
34
|
+
run_scenarios([suite_setup],nil)
|
35
35
|
else
|
36
36
|
@dispatcher.exit
|
37
37
|
raise RutemaError,"Did not parse any tests succesfully"
|
@@ -41,7 +41,7 @@ module Rutema
|
|
41
41
|
@runner.teardown=teardown
|
42
42
|
#running - at this point we've done any and all checks and we're stepping on the gas
|
43
43
|
message("running")
|
44
|
-
run_scenarios(tests,
|
44
|
+
run_scenarios(tests,suite_setup,suite_teardown)
|
45
45
|
end
|
46
46
|
message("end")
|
47
47
|
@dispatcher.exit
|
@@ -62,8 +62,8 @@ module Rutema
|
|
62
62
|
specs=parse_specifications(@configuration.tests)
|
63
63
|
end
|
64
64
|
specs.compact!
|
65
|
-
|
66
|
-
return [
|
65
|
+
suite_setup,suite_teardown,setup,teardown=parse_specials(@configuration)
|
66
|
+
return [suite_setup,suite_teardown,setup,teardown,specs]
|
67
67
|
end
|
68
68
|
private
|
69
69
|
def parse_specifications tests
|
@@ -79,11 +79,15 @@ module Rutema
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
def parse_specials configuration
|
82
|
-
|
82
|
+
suite_setup=nil
|
83
|
+
suite_teardown=nil
|
83
84
|
setup=nil
|
84
85
|
teardown=nil
|
85
|
-
if configuration.
|
86
|
-
|
86
|
+
if configuration.suite_setup
|
87
|
+
suite_setup=parse_specification(configuration.suite_setup)
|
88
|
+
end
|
89
|
+
if configuration.suite_teardown
|
90
|
+
suite_teardown=parse_specification(configuration.suite_teardown)
|
87
91
|
end
|
88
92
|
if configuration.setup
|
89
93
|
setup=parse_specification(configuration.setup)
|
@@ -91,21 +95,24 @@ module Rutema
|
|
91
95
|
if configuration.teardown
|
92
96
|
teardown=parse_specification(configuration.teardown)
|
93
97
|
end
|
94
|
-
return
|
98
|
+
return suite_setup,suite_teardown,setup,teardown
|
95
99
|
end
|
96
|
-
def run_scenarios specs,
|
100
|
+
def run_scenarios specs,suite_setup,suite_teardown
|
97
101
|
if specs.empty?
|
98
102
|
error(nil,"No tests to run")
|
99
103
|
else
|
100
|
-
if
|
101
|
-
if run_test(
|
104
|
+
if suite_setup
|
105
|
+
if run_test(suite_setup)==:success
|
102
106
|
specs.each{|s| run_test(s)}
|
103
107
|
else
|
104
|
-
error(nil,"
|
108
|
+
error(nil,"Suite setup test failed")
|
105
109
|
end
|
106
110
|
else
|
107
111
|
specs.each{|spec| run_test(spec)}
|
108
112
|
end
|
113
|
+
if suite_teardown
|
114
|
+
run_test(suite_teardown)
|
115
|
+
end
|
109
116
|
end
|
110
117
|
end
|
111
118
|
def run_test specification
|
@@ -130,7 +137,8 @@ module Rutema
|
|
130
137
|
end
|
131
138
|
def is_special? test_identifier
|
132
139
|
full_path=File.expand_path(test_identifier)
|
133
|
-
return full_path==@configuration.
|
140
|
+
return full_path==@configuration.suite_setup ||
|
141
|
+
full_path==@configuration.suite_teardown ||
|
134
142
|
full_path==@configuration.setup ||
|
135
143
|
full_path==@configuration.teardown
|
136
144
|
end
|
data/lib/rutema/parsers/xml.rb
CHANGED
@@ -145,8 +145,10 @@ module Rutema
|
|
145
145
|
self.send(:"element_#{step.step_type}",step)
|
146
146
|
rescue
|
147
147
|
raise ParserError, $!.message
|
148
|
-
end
|
149
|
-
|
148
|
+
end#begin
|
149
|
+
elsif @configuration.parser["strict_mode"]
|
150
|
+
raise ParserError,"No command element associated with #{step.step_type}. Missing element_#{step.step_type}"
|
151
|
+
end
|
150
152
|
end#each
|
151
153
|
end#chdir
|
152
154
|
return spec
|
data/lib/rutema/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rutema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.pre13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vassilis Rizopoulos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: patir
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
61
|
+
version: '3.15'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
68
|
+
version: '3.15'
|
69
69
|
description: "rutema [http://github.com/damphyr/rutema](http://github.com/damphyr/rutema)\n\nrutema
|
70
70
|
is a test execution tool and a framework for organizing and managing test execution
|
71
71
|
across different tools.\n\nIt enables the combination of different test tools while
|