rutema 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.4.2 / 2007-12-05
2
+ * rutemah code cleaned up
3
+ * Bugfix: MinimalXMLParser now handles relative paths in command elements correctly
4
+ * distro_test added to the gem
5
+ * Distro test documented, documentation pages updated
1
6
  == 0.4.1 / 2007-12-04
2
7
  * Documented MinimalXMLParser
3
8
  * More debug logs
data/Manifest.txt CHANGED
@@ -37,3 +37,8 @@ test/samples/tests/no_title.spec
37
37
  test/samples/tests/sample.spec
38
38
  test/samples/valid_config.rb
39
39
  test/samples/rutemah_config.rb
40
+ test/distro_test/config/minimal.rutema
41
+ test/distro_test/specs/T001.spec
42
+ test/distro_test/specs/T002.spec
43
+ test/distro_test/specs/T003.spec
44
+ test/distro_test/specs/T004.spec
data/README.txt CHANGED
@@ -6,22 +6,26 @@ Rutema provides the basis for building tools that can manage the execution of te
6
6
 
7
7
  It's purpose is to provide a set of classes and a framework that will allow testers to specify and execute tests in heterogeneous testing environments.
8
8
 
9
- A heterogeneous testing environment would be one where several testing tools are put to use, each with it's own scripts and ways to define tests.
10
- Rutema will allow you to combine tools, take care of logging, reporting, archiving of results and formalize execution of automated and manual tests.
9
+ Rutema will allows you to combine tools, takes care of logging, reporting, archiving of results and formalizes execution of automated and manual tests.
11
10
 
12
11
  For more information look at http://patir.rubyforge.org/rutema
13
12
 
14
13
  == FEATURES/PROBLEMS:
15
14
 
16
- *
15
+ * rutemax - runs tests
16
+ * rutemah - a tool to create reports out of the test result database
17
+ * rutemaweb - a web frontend for the test result database
17
18
 
18
19
  == SYNOPSIS:
19
20
 
20
21
  Once installed (which is simple) and configured (which can vary from simple to highly complex but is usually more complex than tying your shoelaces) you can do:
21
22
 
22
23
  rutemax -c sample.cfg path/to/test.specification - to run a single test
24
+
23
25
  rutemax -c sample.cfg all - to run all the tests
26
+
24
27
  rutemax -c sample.cfg attended - to run all attended tests
28
+
25
29
  rutemax -c sample.cfg unattended - to run all unattended tests
26
30
 
27
31
  == REQUIREMENTS:
@@ -37,7 +37,7 @@ module Rutema
37
37
  opt.on("--debug", "-d","Turns on debug messages") { $DEBUG=true }
38
38
  opt.on("--config FILE", "-c FILE",String,"Loads the configuration from FILE") { |@config_file|}
39
39
  opt.on("--log FILE", "-l FILE",String,"Redirects the log output to FILE") { |@log_file|}
40
- opt.on("-V", "--version","Displays the version") { $stdout.puts("v#{VERSION_MAJOR}.#{VERSION_MINOR}");exit 0 }
40
+ opt.on("-v", "--version","Displays the version") { $stdout.puts("v#{Version::STRING}");exit 0 }
41
41
  opt.on("--help", "-h", "-?", "This text") { $stdout.puts opt; exit 0 }
42
42
  opt.on("Commands are:")
43
43
  opt.on("all - lists all entries in the database")
@@ -52,16 +52,6 @@ module Rutema
52
52
  end
53
53
  end
54
54
  end#parse_command_line
55
- private
56
- def application_flow
57
- logger=Patir.setup_logger(@log_file)
58
- if @config_file
59
- cfg=RutemaHConfigurator.new(@config_file,logger).configuration()
60
- puts Historian.new(cfg,logger).history(@command)
61
- else
62
- logger.error("No configuration file specified")
63
- end
64
- end
65
55
  end
66
56
 
67
57
  class Historian
data/lib/rutema/system.rb CHANGED
@@ -16,7 +16,7 @@ module Rutema
16
16
  module Version
17
17
  MAJOR=0
18
18
  MINOR=4
19
- TINY=1
19
+ TINY=2
20
20
  STRING=[ MAJOR, MINOR, TINY ].join( "." )
21
21
  end
22
22
  #Is raised when an error is found in a specification
@@ -166,28 +166,33 @@ module Rutema
166
166
  class MinimalXMLParser<BaseXMLParser
167
167
  def parse_specification param
168
168
  spec = super(param)
169
- spec.scenario.steps.each do |step|
170
- case step.step_type
171
- when "echo"
172
- step.cmd=Patir::RubyCommand.new("echo"){|cmd| cmd.output="#{step.text}";$stdout.puts(cmd.output) ;:success}
173
- when "command"
174
- raise ParserError,"missing required attribute cmd in #{step}" unless step.has_cmd?
175
- wd=step.working_directory if step.has_working_directory?
176
- step.cmd=Patir::ShellCommand.new(:cmd=>step.cmd,:working_directory=>wd)
177
- when "prompt"
178
- step.attended=true
179
- spec.scenario.attended=true
180
- step.cmd=Patir::RubyCommand.new("prompt") do |cmd|
181
- cmd.output=""
182
- cmd.error=""
183
- if HighLine.new.agree("#{step.text}?")
184
- :success
185
- else
186
- :error
187
- end#if
188
- end#do rubycommand
189
- end#case
190
- end#do spec.scenario.steps
169
+ #change into the directory the spec is in to handle relative paths correctly
170
+ prev_dir=Dir.pwd
171
+ Dir.chdir(File.dirname(spec.filename))
172
+ spec.scenario.steps.each do |step|
173
+ case step.step_type
174
+ when "echo"
175
+ step.cmd=Patir::RubyCommand.new("echo"){|cmd| cmd.output="#{step.text}";$stdout.puts(cmd.output) ;:success}
176
+ when "command"
177
+ raise ParserError,"missing required attribute cmd in #{step}" unless step.has_cmd?
178
+ wd=Dir.pwd
179
+ wd=step.working_directory if step.has_working_directory?
180
+ step.cmd=Patir::ShellCommand.new(:cmd=>step.cmd,:working_directory=>File.expand_path(wd))
181
+ when "prompt"
182
+ step.attended=true
183
+ spec.scenario.attended=true
184
+ step.cmd=Patir::RubyCommand.new("prompt") do |cmd|
185
+ cmd.output=""
186
+ cmd.error=""
187
+ if HighLine.new.agree("#{step.text}?")
188
+ :success
189
+ else
190
+ :error
191
+ end#if
192
+ end#do rubycommand
193
+ end#case
194
+ end#do spec.scenario.steps
195
+ Dir.chdir(prev_dir)
191
196
  return spec
192
197
  end
193
198
  end
@@ -453,9 +458,11 @@ module Rutema
453
458
  @logger.warn("No command associated with step '#{step.step_type}'")
454
459
  end
455
460
  msg=step.to_s
461
+ p step if $DEBUG
456
462
  # we might not have a command object
457
463
  if step.has_cmd? && step.cmd.executed? && !step.cmd.success?
458
464
  msg<<"\n#{step.cmd.output}" unless step.cmd.output.empty?
465
+ msg<<"\n#{step.cmd.error}" unless step.cmd.error.empty?
459
466
  end
460
467
  if step.status==:error
461
468
  @logger.error(msg)
@@ -0,0 +1,7 @@
1
+ configuration.parser={:class=>Rutema::MinimalXMLParser}
2
+ configuration.tests=[
3
+ "../specs/T001.spec",
4
+ "../specs/T002.spec",
5
+ "../specs/T003.spec",
6
+ "../specs/T004.spec"
7
+ ]
@@ -0,0 +1,7 @@
1
+ <specification name="T001">
2
+ <title>T001</title>
3
+ <description>An echo test</description>
4
+ <scenario>
5
+ <echo>Hello Testing World</echo>
6
+ </scenario>
7
+ </specification>
@@ -0,0 +1,7 @@
1
+ <specification name="T002">
2
+ <title>T002</title>
3
+ <description>A command test</description>
4
+ <scenario>
5
+ <command cmd="ls"/>
6
+ </scenario>
7
+ </specification>
@@ -0,0 +1,7 @@
1
+ <specification name="T003">
2
+ <title>T003</title>
3
+ <description>A prompt</description>
4
+ <scenario attended="true">
5
+ <prompt>Are you there</prompt>
6
+ </scenario>
7
+ </specification>
@@ -0,0 +1,7 @@
1
+ <specification name="T004">
2
+ <title>T004</title>
3
+ <description>An implicitly attended test</description>
4
+ <scenario>
5
+ <prompt>Are you (implicitly) there</prompt>
6
+ </scenario>
7
+ </specification>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rutema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ""
6
6
  authors:
7
7
  - Vassilis Rizopoulos
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2007-12-04 00:00:00 +01:00
12
+ date: 2007-12-05 00:00:00 +01:00
13
13
  default_executable: rutemax
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -75,7 +75,7 @@ dependencies:
75
75
  - !ruby/object:Gem::Version
76
76
  version: 1.3.0
77
77
  version:
78
- description: "== DESCRIPTION: Rutema provides the basis for building tools that can manage the execution of tests as well as an example implementation as proof-of-concept for the ideas behind it. It's purpose is to provide a set of classes and a framework that will allow testers to specify and execute tests in heterogeneous testing environments. A heterogeneous testing environment would be one where several testing tools are put to use, each with it's own scripts and ways to define tests. Rutema will allow you to combine tools, take care of logging, reporting, archiving of results and formalize execution of automated and manual tests. For more information look at http://patir.rubyforge.org/rutema == FEATURES/PROBLEMS: *"
78
+ description: "== DESCRIPTION: Rutema provides the basis for building tools that can manage the execution of tests as well as an example implementation as proof-of-concept for the ideas behind it. It's purpose is to provide a set of classes and a framework that will allow testers to specify and execute tests in heterogeneous testing environments. Rutema will allows you to combine tools, takes care of logging, reporting, archiving of results and formalizes execution of automated and manual tests. For more information look at http://patir.rubyforge.org/rutema == FEATURES/PROBLEMS: * rutemax - runs tests * rutemah - a tool to create reports out of the test result database * rutemaweb - a web frontend for the test result database"
79
79
  email: riva@braveworld.net
80
80
  executables:
81
81
  - rutemax
@@ -128,6 +128,11 @@ files:
128
128
  - test/samples/tests/sample.spec
129
129
  - test/samples/valid_config.rb
130
130
  - test/samples/rutemah_config.rb
131
+ - test/distro_test/config/minimal.rutema
132
+ - test/distro_test/specs/T001.spec
133
+ - test/distro_test/specs/T002.spec
134
+ - test/distro_test/specs/T003.spec
135
+ - test/distro_test/specs/T004.spec
131
136
  has_rdoc: true
132
137
  homepage:
133
138
  post_install_message: