com pftt2: support for additional PHPT sections: PFTT/config/gi t_conf.cmd PFTT/lib/scenario/set.rb
| From: | Matt Ficken | Date: | Tue, 25 Oct 2011 01:13:45 +0000 |
| Subject: | com pftt2: support for additional PHPT sections: PFTT/config/gi t_conf.cmd PFTT/lib/scenario/set.rb | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-67157@lists.php.net to get a copy of this message | ||
Commit: 5446b7cea1dfc25435f0152ba2afd678a72b9485
Author: Matt Ficken <v-mafick@.redmond.corp.microsoft.com> Mon, 24 Oct 2011
18:13:45 -0700
Parents: 90500eab112133f325137286e76af9c9121511f7
Branches: master
Link: http://git.php.net/?p=pftt2.git;a=commitdiff;h=5446b7cea1dfc25435f0152ba2afd678a72b9485
Log:
support for additional PHPT sections
Changed paths:
A PFTT/config/git_conf.cmd
A PFTT/lib/scenario/set.rb
Diff:
diff --git a/PFTT/config/git_conf.cmd b/PFTT/config/git_conf.cmd
new file mode 100644
index 0000000..9f19952
--- /dev/null
+++ b/PFTT/config/git_conf.cmd
@@ -0,0 +1,6 @@
+REM configure git
+
+git config --global user.name "Matt Ficken"
+
+git config --global user.email v-mafick@microsoft.com
+
diff --git a/PFTT/lib/scenario/set.rb b/PFTT/lib/scenario/set.rb
new file mode 100644
index 0000000..e7aefd7
--- /dev/null
+++ b/PFTT/lib/scenario/set.rb
@@ -0,0 +1,61 @@
+
+module Scenario
+ class Set
+
+ include TestBenchFactor
+
+ attr_accessor :working_fs, :remote_fs, :date, :database
+ attr_reader :id
+
+ def initialize(id, working_filesystem_scenario)
+ @id = id
+ end
+
+ def execute_script_start
+ values.each do |ctx|
+ ctx.execute_script_start(env, test, script_type, deployed_script, self.php_binary,
@php_build, current_ini, @host, (@host.posix?)?(:posix):(:windows) )
+ end
+ end
+
+ def execute_script_stop
+ values.map do |ctx|
+ ctx.execute_script_stop(test, script_type, deployed_script, self.php_binary, @php_build,
@host)
+ end
+ end
+
+ def ini(platform, ini=nil)
+ if platform != :windows and platform != :posix
+ raise ArgumentError, 'platform must be :windows or :posix'
+ end
+
+ values.each do |scn|
+ scn.execute_script_start(env, test, :test, deployed_script, self.php_binary, @php_build,
@current_ini, @host, platform)
+ end
+ end
+
+ def values
+ list = [@working_fs]
+ if @remote_fs
+ list << @remote_fs
+ end
+ if @date
+ list << @date
+ end
+ if @database
+ list << @database
+ end
+ return list
+ end
+
+ def teardown(host)
+ values.each do |scn|
+ scn.teardown(host)
+ end
+ end
+
+ def == (o)
+ o.instance_of?(Scenario::Set) and o.id == @id
+ end
+
+ end
+end