bigbench 0.0.4 → 0.0.5

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.
Files changed (77) hide show
  1. data/README.textile +29 -249
  2. data/bigbench.gemspec +1 -0
  3. data/bin/bigbench +1 -1
  4. data/dev/request_sequence.dot +235 -0
  5. data/dev/request_sequence.pdf +0 -0
  6. data/dev/sequence.rb +48 -0
  7. data/doc/Array.html +5 -5
  8. data/doc/BigBench.html +27 -60
  9. data/doc/BigBench/Benchmark.html +5 -5
  10. data/doc/BigBench/Benchmark/Benchmark.html +8 -8
  11. data/doc/BigBench/Benchmark/Looper.html +5 -5
  12. data/doc/BigBench/Bot.html +5 -5
  13. data/doc/BigBench/Configuration.html +29 -53
  14. data/doc/BigBench/Executor.html +14 -95
  15. data/doc/BigBench/Executor/Executable.html +551 -0
  16. data/doc/BigBench/Fragment.html +5 -5
  17. data/doc/BigBench/Fragment/Fragment.html +5 -5
  18. data/doc/BigBench/Output.html +7 -8
  19. data/doc/BigBench/PostProcessor.html +8 -8
  20. data/doc/BigBench/PostProcessor/Context.html +219 -0
  21. data/doc/BigBench/PostProcessor/Environment.html +5 -5
  22. data/doc/BigBench/PostProcessor/Environment/Appearings.html +5 -5
  23. data/doc/BigBench/PostProcessor/Environment/AttributeCluster.html +5 -5
  24. data/doc/BigBench/PostProcessor/Environment/BenchmarkNotFound.html +5 -5
  25. data/doc/BigBench/PostProcessor/Environment/Cluster.html +5 -5
  26. data/doc/BigBench/PostProcessor/Environment/NormalDistribution.html +5 -5
  27. data/doc/BigBench/PostProcessor/Environment/PolynomialRegression.html +5 -5
  28. data/doc/BigBench/PostProcessor/Environment/Statistics.html +5 -5
  29. data/doc/BigBench/PostProcessor/Graphs.html +5 -5
  30. data/doc/BigBench/PostProcessor/Graphs/LineGraph.html +5 -5
  31. data/doc/BigBench/PostProcessor/Graphs/PieGraph.html +5 -5
  32. data/doc/BigBench/PostProcessor/InvalidProcessor.html +6 -6
  33. data/doc/BigBench/PostProcessor/Processor.html +6 -6
  34. data/doc/BigBench/PostProcessor/Statistics.html +5 -5
  35. data/doc/BigBench/PostProcessor/Test.html +6 -6
  36. data/doc/BigBench/PostProcessor/TestPretty.html +249 -0
  37. data/doc/BigBench/Runner.html +5 -5
  38. data/doc/BigBench/Runner/NoBenchmarksDefined.html +5 -5
  39. data/doc/BigBench/Store.html +8 -8
  40. data/doc/BigBench/Tracker.html +5 -5
  41. data/doc/BigBench/Tracker/Tracker.html +5 -5
  42. data/doc/EventMachineLoop.html +5 -5
  43. data/doc/Float.html +5 -5
  44. data/doc/Gemfile.html +5 -5
  45. data/doc/Helpers.html +5 -5
  46. data/doc/Object.html +24 -5
  47. data/doc/README_rdoc.html +51 -281
  48. data/doc/Rakefile.html +5 -5
  49. data/doc/created.rid +46 -46
  50. data/doc/index.html +51 -281
  51. data/doc/js/search_index.js +1 -1
  52. data/doc/lib/bigbench/help/executor_txt.html +14 -29
  53. data/doc/table_of_contents.html +63 -68
  54. data/lib/bigbench.rb +2 -0
  55. data/lib/bigbench/benchmark.rb +3 -3
  56. data/lib/bigbench/configuration.rb +29 -68
  57. data/lib/bigbench/executor.rb +100 -130
  58. data/lib/bigbench/help/executor.txt +9 -22
  59. data/lib/bigbench/output.rb +2 -3
  60. data/lib/bigbench/post_processor.rb +16 -4
  61. data/lib/bigbench/runner.rb +0 -1
  62. data/lib/bigbench/store.rb +2 -2
  63. data/lib/bigbench/templates/test_plan.rb.erb +17 -0
  64. data/lib/bigbench/version.rb +1 -1
  65. data/spec/configure_spec.rb +7 -18
  66. data/spec/executor_spec.rb +25 -35
  67. data/spec/post_processor_spec.rb +31 -1
  68. data/spec/post_processors/environment_spec.rb +5 -3
  69. data/spec/post_processors/graphs_spec.rb +8 -3
  70. data/spec/post_processors/statistics_spec.rb +6 -1
  71. data/spec/runner_spec.rb +7 -6
  72. data/spec/store_spec.rb +4 -3
  73. data/spec/tests/local.rb +5 -5
  74. data/spec/tests/with_post_processor.rb +5 -5
  75. data/spec/tracker_spec.rb +12 -8
  76. metadata +48 -31
  77. data/dev/test.rb +0 -13
@@ -5,145 +5,115 @@ module BigBench
5
5
  # :include: executor.txt
6
6
  module Executor
7
7
 
8
- COMMANDS = [
9
- "--help", "show help",
10
- "run local PATH_TO_TEST",
11
- "run bots PATH_TO_TEST [REDIS_URL_WITH_PORT REDIS_PASSWORD]",
12
- "start bot [REDIS_URL_WITH_PORT REDIS_PASSWORD]",
13
- "reset all [REDIS_URL_WITH_PORT REDIS_PASSWORD]",
14
- "run postprocessors PATH_TO_TEST",
15
- "run postprocessor PATH_TO_TEST POSTPROCESSOR"
16
- ]
17
-
18
- # Is thrown when the command is not known
19
- class InvalidCommand < StandardError
20
- def message
21
- puts "\n\n"
22
- puts "Sorry, could not compile your command. Please enter one of the following commands:\n\n"
23
- COMMANDS.each{ |command| puts command }
24
- puts " "
25
-
26
- "Sorry, could not compile your command."
27
- end
28
- end
29
-
30
- # Parses and runs the BigBench funtion that is supplied via the commandline's ARGV. It
31
- # throws an <tt>InvalidCommand</tt> exception if the command is unknown.
32
- def self.run!(argv)
33
- BigBench::Output.start
8
+ class Executable < Thor
9
+ include Thor::Actions
34
10
 
35
- check_arguments!(argv)
36
- send to_executor_method(argv), argv
11
+ # Templates are here
12
+ def self.source_root
13
+ File.join(File.dirname(__FILE__), "templates")
14
+ end
37
15
 
38
- BigBench::Output.done
39
- end
40
-
41
- private
42
-
43
- # Maps the incoming ARGV to a method
44
- def self.to_executor_method(argv)
45
- return "show_help" if argv.first == "--help"
46
- "#{argv[0]}_#{argv[1]}".to_sym
47
- end
48
-
49
- # Checks if the supplied ARGV has a valid and useable form
50
- def self.check_arguments!(argv)
51
- raise InvalidCommand.new if argv.nil? or argv.empty?
52
- raise InvalidCommand.new unless respond_to?(to_executor_method(argv))
53
- true
54
- end
55
-
56
- # Runs a local test with the specified test.rb. For this mode no redis is needed.
57
- def self.run_local(argv)
58
- BigBench.load_test! File.open(argv[2], "rb"){ |file| file.read }
59
- BigBench.run!
60
- BigBench.write_local_trackings_to_file!
61
- BigBench.run_post_processors!
62
- end
63
-
64
- # Runs a test on all available bots with the specified test.rb
65
- #
66
- # bigbench run bots test.rb http://localhost:6379 password
67
- #
68
- def self.run_bots(argv)
16
+ # Version and Help
17
+ desc "-v", "Show the version"
18
+ method_options %w( version -v ) => :boolean
19
+ def default
20
+ options.version? ? puts(BigBench::VERSION) : help
21
+ end
22
+ default_task :default
69
23
 
70
- # Load and validate tests
71
- test = File.open(argv[2], "rb"){ |file| file.read }
72
- BigBench.load_test!(test)
73
- BigBench.config.mode = :bots
24
+ # Run Local
25
+ desc "local TEST_FILE", "Run the TEST_FILE on the local machine"
26
+ def local(file)
27
+ BigBench.load_test! File.open(file, "rb"){ |file| file.read }
28
+ BigBench.run!
29
+ BigBench.write_local_trackings_to_file!
30
+ BigBench.run_post_processors!
31
+ end
74
32
 
75
- # Initialize redis
76
- argv.shift(3)
77
- BigBench::Store.setup!(*argv)
33
+ # Run Bots
34
+ desc "bots TEST_FILE [REDIS_URL_WITH_PORT] [REDIS_PASSWORD]", "Run the TEST_FILE on all bots"
35
+ def bots(file, redis_url = nil, redis_password = nil)
36
+
37
+ # Load and validate tests
38
+ test = File.open(file, "rb"){ |file| file.read }
39
+ BigBench.load_test!(test)
40
+ BigBench.config.mode = :bots
41
+
42
+ # Initialize redis
43
+ BigBench::Store.setup!(redis_url, redis_password)
44
+
45
+ # Load current test to redis & start bots
46
+ BigBench::Store.test = test
47
+ BigBench::Store.start
48
+ BigBench::Output.deployed_test
49
+
50
+ # Wait for bots to run the tests
51
+ @is_running = true
52
+ timer = Thread.new{
53
+ sleep(BigBench.duration.to_i)
54
+ BigBench::Store.stop
55
+ @is_running = false
56
+ }
57
+
58
+ BigBench::Output.starting_bots_loop
59
+ loop{
60
+ bots = BigBench::Store.bots
61
+ BigBench::Output.running_bots_loop(bots)
62
+ sleep(1)
63
+ break if !@is_running and bots.size == 0
64
+ }
65
+
66
+ # Gather trackings from redis and write them to the file
67
+ BigBench::Output.finished_bots_loop
68
+ BigBench.write_store_trackings_to_file!
69
+ BigBench.run_post_processors!
70
+ BigBench::Store.reset!
71
+ end
78
72
 
79
- # Load current test to redis & start bots
80
- BigBench::Store.test = test
81
- BigBench::Store.start
82
- BigBench::Output.deployed_test
73
+ # Start Bot
74
+ desc "bot [REDIS_URL_WITH_PORT] [REDIS_PASSWORD]", "Start a bot on the current machine"
75
+ def bot(redis_url = nil, redis_password = nil)
76
+ BigBench::Store.setup!(redis_url, redis_password)
77
+
78
+ loop {
79
+ BigBench::Output.bot_is_checking
80
+ BigBench::Bot.check_test!
81
+ sleep(BigBench.config.bot_checks_every.to_i)
82
+ }
83
+ end
83
84
 
84
- # Wait for bots to run the tests
85
- @is_running = true
86
- timer = Thread.new{
87
- sleep(BigBench.duration.to_i)
88
- BigBench::Store.stop
89
- @is_running = false
90
- }
85
+ # Post Process
86
+ desc "process TEST_FILE [POST_PROCESSOR]", "Run all post processors of the testfile or the single POST_PROCESSOR"
87
+ def process(file, post_processor = nil)
88
+ BigBench.load_test! File.open(file, "rb"){ |file| file.read }
89
+
90
+ if post_processor
91
+ BigBench::PostProcessor.reset!
92
+ BigBench.post_process(post_processor)
93
+ BigBench.run_post_processors!
94
+ else
95
+ BigBench.run_post_processors!
96
+ end
97
+ end
91
98
 
92
- BigBench::Output.starting_bots_loop
93
- loop{
94
- bots = BigBench::Store.bots
95
- BigBench::Output.running_bots_loop(bots)
96
- sleep(1)
97
- break if !@is_running and bots.size == 0
98
- }
99
+ # Reset
100
+ desc "reset [REDIS_URL_WITH_PORT] [REDIS_PASSWORD]", "Reset everything including the redis storage"
101
+ def reset(redis_url = nil, redis_password = nil)
102
+ BigBench::Store.setup!(redis_url, redis_password)
103
+ BigBench::Store.reset!
104
+ BigBench::Configuration.reset!
105
+ BigBench::Benchmark.reset!
106
+ BigBench::Output.reset
107
+ end
99
108
 
100
- # Gather trackings from redis and write them to the file
101
- BigBench::Output.finished_bots_loop
102
- BigBench.write_store_trackings_to_file!
103
- BigBench.run_post_processors!
104
- BigBench::Store.reset!
105
- end
106
-
107
- # Starts the bot that listens for tests on the redis
108
- def self.start_bot(argv)
109
- argv.shift(2)
110
- BigBench::Store.setup!(*argv)
109
+ # Generator
110
+ desc "generate TEST_FILE", "Generates a simple test file to customize further"
111
+ def generate(name)
112
+ @name = name
113
+ template "test_plan.rb.erb", "#{name}.rb"
114
+ end
111
115
 
112
- loop {
113
- BigBench::Output.bot_is_checking
114
- BigBench::Bot.check_test!
115
- sleep(BigBench.config.bot_checks_every.to_i)
116
- }
117
- end
118
-
119
- # Shows the command line help
120
- def self.show_help(argv)
121
- File.open("lib/bigbench/help/executor.txt", "rb"){ |file| file.read }
122
- end
123
-
124
- # Resets everything
125
- def self.reset_all(argv)
126
- argv.shift(2)
127
- BigBench::Store.setup!(*argv)
128
- BigBench::Store.reset!
129
- BigBench::Configuration.reset!
130
- BigBench::Benchmark.reset!
131
- BigBench::Output.reset
132
- end
133
-
134
- # Re-runs all receipt defined post processors
135
- def self.run_postprocessors(argv)
136
- BigBench.load_test! File.open(argv[2], "rb"){ |file| file.read }
137
- BigBench.run_post_processors!
138
116
  end
139
-
140
- # Runs a new postprocessor for receipt
141
- def self.run_postprocessor(argv)
142
- BigBench.load_test! File.open(argv[2], "rb"){ |file| file.read }
143
- BigBench::PostProcessor.reset!
144
- BigBench.post_process(argv[3])
145
- BigBench.run_post_processors!
146
- end
147
-
117
+
148
118
  end
149
119
  end
@@ -1,22 +1,9 @@
1
- Usage:
2
- # Local Testing
3
- bigbench run local PATH_TO_TEST # Runs a test from the local machine. No redis needed.
4
-
5
- # Remote Testing
6
- bigbench run bots PATH_TO_TEST [REDIS_URL_WITH_PORT REDIS_PASSWORD] # Deploys and starts the test on all bots
7
- bigbench start bot [REDIS_URL_WITH_PORT REDIS_PASSWORD] # Starts a bot on a remote machine
8
-
9
- # Reseting
10
- bigbench reset all # Resets everything
11
-
12
- # Post Processors
13
- bigbench run postprocessors PATH_TO_TEST # Runs all post processors of the test without running the test itself
14
- bigbench run postprocessor PATH_TO_TEST POSTPROCESSOR # Runs the specified post processor on the output file
15
-
16
- # Help
17
- bigbench --help || show help # Displays this help
18
-
19
- Options:
20
- REDIS_URL_WITH_PORT # Defaults to http://localhost:6379
21
- REDIS_PASSWORD # Defaults to no password
22
- POSTPROCESSOR # A post processor module or its short name e.g. 'statistics'
1
+ Tasks:
2
+ bigbench -v # Show the version
3
+ bigbench bot [REDIS_URL_WITH_PORT] [REDIS_PASSWORD] # Start a bot on the current machine
4
+ bigbench bots TEST_FILE [REDIS_URL_WITH_PORT] [REDIS_PASSWORD] # Run the TEST_FILE on all bots
5
+ bigbench generate TEST_FILE # Generates a simple test file to customize further
6
+ bigbench help [TASK] # Describe available tasks or one specific task
7
+ bigbench local TEST_FILE # Run the TEST_FILE on the local machine
8
+ bigbench process TEST_FILE [POST_PROCESSOR] # Run all post processors of the testfile or the single POST_PROCESSOR
9
+ bigbench reset [REDIS_URL_WITH_PORT] [REDIS_PASSWORD] # Reset everything including the redis storage
@@ -102,13 +102,12 @@ module BigBench
102
102
  end
103
103
 
104
104
  def self.bot_is_checking
105
- puts "Checking for new tests at #{Time.now}"
105
+ puts "#{Time.now}: Checking for new test plan"
106
106
  $stdout.flush
107
107
  end
108
108
 
109
109
  def self.bot_received_test_instructions
110
- puts "\n-> Received\n"
111
- puts "Received test instructions\n"
110
+ puts "#{Time.now}: Received new test plan"
112
111
  $stdout.flush
113
112
  end
114
113
 
@@ -75,7 +75,7 @@ module BigBench
75
75
  # Run the block of code or the run! method of the processor
76
76
  def run!
77
77
  @runs += 1
78
- PostProcessor::Environment.module_exec(@options, &@proc)
78
+ Context.module_exec(@options, &@proc)
79
79
  end
80
80
 
81
81
  private
@@ -94,9 +94,13 @@ module BigBench
94
94
 
95
95
  def processor_to_module(processor)
96
96
  return processor if processor.is_a? Module
97
- mod = "BigBench::PostProcessor::#{processor.to_s.camelize}"
98
- require mod.underscore.sub('big_bench', 'bigbench')
99
- mod.constantize
97
+
98
+ module_name = "BigBench::PostProcessor::#{processor.to_s.camelize}"
99
+ module_constant = module_name.constantize
100
+ return module_constant if module_constant.is_a? Module
101
+
102
+ require module_name.underscore.sub('big_bench', 'bigbench')
103
+ module_constant
100
104
  end
101
105
  end
102
106
 
@@ -116,6 +120,14 @@ module BigBench
116
120
  Environment.reset!
117
121
  end
118
122
 
123
+ # The context in which post processor procs are evaluated
124
+ module Context
125
+ class << self
126
+ include Environment
127
+ include ActionView::Helpers
128
+ end
129
+ end
130
+
119
131
  # Thrown if a processor wasn't initialized the right way
120
132
  class InvalidProcessor < StandardError
121
133
  def message
@@ -46,7 +46,6 @@ module BigBench
46
46
  def self.load_test!(test)
47
47
  BigBench::Benchmark.reset!
48
48
  eval(test)
49
- check_config!
50
49
  BigBench::Output.loaded_tests
51
50
  end
52
51
 
@@ -13,8 +13,8 @@ module BigBench
13
13
 
14
14
  # Setup the redis storage. Default values are <tt>localhost:6379</tt> and no password.
15
15
  # This needs to be called for any bot test
16
- def self.setup!(url = "localhost:6379", password = nil)
17
- uri = URI(url)
16
+ def self.setup!(url = nil, password = nil)
17
+ uri = URI(url || "localhost:6379")
18
18
  @redis = ::Redis.new :host => uri.host, :port => uri.port, :password => password
19
19
  true
20
20
  end
@@ -0,0 +1,17 @@
1
+ BigBench.configure do |config|
2
+ config.duration = 2.minutes
3
+ config.output = "<%= @name %>.ljson"
4
+ config.users = 10
5
+ end
6
+
7
+ # benchmark "index page" => "http://localhost:3000" do
8
+ # get "/"
9
+ # get "/posts"
10
+ # post "/posts", :params => { :title => "A new Post", :body => "This is some fancy text" }
11
+ # end
12
+ #
13
+ # benchmark "managing posts" => "http://localhost:3000" do
14
+ # post "/posts", :params => { :title => "A new Post", :body => "This is some fancy text" }
15
+ # end
16
+
17
+ post_process :statistics
@@ -1,3 +1,3 @@
1
1
  module BigBench
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -4,11 +4,11 @@ describe BigBench::Configuration do
4
4
 
5
5
  it "should store the config values" do
6
6
 
7
- BigBench.configure = {
8
- :duration => 10.seconds,
9
- :output => "test.ljson",
10
- :users => 20
11
- }
7
+ BigBench.configure do |config|
8
+ config.duration = 10.seconds
9
+ config.output = "test.ljson"
10
+ config.users = 20
11
+ end
12
12
 
13
13
  BigBench.config.duration.should == 10.seconds
14
14
  BigBench.config.output.should == "test.ljson"
@@ -21,19 +21,8 @@ describe BigBench::Configuration do
21
21
  BigBench.config.duration.should == 5.seconds
22
22
  end
23
23
 
24
- it "should check the minimal options" do
25
- BigBench.config.should_not be_valid
26
-
27
- BigBench.configure = {
28
- :duration => 10.seconds,
29
- :output => "test.ljson",
30
- :users => 20
31
- }
32
- BigBench.config.should be_valid
33
- end
34
-
35
- it "should allow to check the validity of the config" do
36
- lambda {BigBench.check_config!}.should raise_error(BigBench::Configuration::InvalidOptions, "At least: #{BigBench::Configuration::Config::VALIDATE_OPTIONS.join(', ')} are required")
24
+ it "should raise an exception if no configure block is specified" do
25
+ lambda {BigBench.configure}.should raise_error
37
26
  end
38
27
 
39
28
  end
@@ -2,34 +2,14 @@ require_relative "./helpers"
2
2
 
3
3
  describe BigBench::Executor do
4
4
 
5
- context "should raise an argument error for" do
6
-
7
- it "nil arguments" do
8
- argv = nil
9
- lambda{ BigBench::Executor.run!(argv) }.should raise_exception(BigBench::Executor::InvalidCommand)
10
- end
11
-
12
- it "empty arguments" do
13
- argv = []
14
- lambda{ BigBench::Executor.run!(argv) }.should raise_exception(BigBench::Executor::InvalidCommand)
15
- end
16
-
17
- it "weird arguments" do
18
- argv = ["something"]
19
- lambda{ BigBench::Executor.run!(argv) }.should raise_exception(BigBench::Executor::InvalidCommand)
20
- end
21
-
22
- it "longer weird arguments" do
23
- argv = ["something", "really", "strange"]
24
- lambda{ BigBench::Executor.run!(argv) }.should raise_exception(BigBench::Executor::InvalidCommand)
25
- end
26
-
5
+ before(:each) do
6
+ Dir.chdir File.dirname(__FILE__)
27
7
  end
28
8
 
29
9
  it "should run a local test with trackings" do
30
10
 
31
- argv = ["run", "local", "spec/tests/local.rb"]
32
- BigBench::Executor.run!(argv)
11
+ argv = ["local", "tests/local.rb"]
12
+ BigBench::Executor::Executable.start(argv)
33
13
 
34
14
  BigBench.benchmarks.size.should == 2
35
15
  BigBench.benchmarks.each{ |benchmark| benchmark.runs.should == 1 }
@@ -45,8 +25,8 @@ describe BigBench::Executor do
45
25
 
46
26
  it "should run a bot test" do
47
27
 
48
- argv = ["run", "bots", "spec/tests/local.rb"]
49
- BigBench::Executor.run!(argv)
28
+ argv = ["bots", "tests/local.rb"]
29
+ BigBench::Executor::Executable.start(argv)
50
30
 
51
31
  BigBench.benchmarks.size.should == 2
52
32
  BigBench.benchmarks.each{ |benchmark| benchmark.runs.should == 0 }
@@ -61,17 +41,17 @@ describe BigBench::Executor do
61
41
  end
62
42
 
63
43
  it "should show the help file" do
64
- argv = ["--help"]
65
- lambda{ BigBench::Executor.run!(argv) }.should_not raise_exception
66
- File.exists?("lib/bigbench/help/executor.txt").should be_true
44
+ argv = ["help"]
45
+ lambda{ BigBench::Executor::Executable.start(argv) }.should_not raise_exception
46
+ File.exists?("../lib/bigbench/help/executor.txt").should be_true
67
47
  end
68
48
 
69
49
  it "should reset everything" do
70
50
  BigBench::Store.setup!("http://localhost:6379").should be_true
71
51
  BigBench::Store.test = "something"
72
52
 
73
- argv = ["reset", "all"]
74
- BigBench::Executor.run!(argv)
53
+ argv = ["reset"]
54
+ BigBench::Executor::Executable.start(argv)
75
55
 
76
56
  BigBench.benchmarks.size.should == 0
77
57
  BigBench::Store.test.should be_nil
@@ -79,8 +59,8 @@ describe BigBench::Executor do
79
59
 
80
60
  it "should re-run the post processors from a receipt" do
81
61
 
82
- argv = ["run", "postprocessors", "spec/tests/with_post_processor.rb"]
83
- BigBench::Executor.run!(argv)
62
+ argv = ["process", "tests/with_post_processor.rb"]
63
+ BigBench::Executor::Executable.start(argv)
84
64
 
85
65
  BigBench.benchmarks.size.should == 1
86
66
  BigBench.benchmarks.each{ |benchmark| benchmark.runs.should == 0 }
@@ -96,8 +76,8 @@ describe BigBench::Executor do
96
76
 
97
77
  it "should run a single post processor for a single test" do
98
78
 
99
- argv = ["run", "postprocessor", "spec/tests/with_post_processor.rb", "statistics"]
100
- BigBench::Executor.run!(argv)
79
+ argv = ["process", "tests/with_post_processor.rb", "statistics"]
80
+ BigBench::Executor::Executable.start(argv)
101
81
 
102
82
  BigBench.benchmarks.size.should == 1
103
83
  BigBench.benchmarks.each{ |benchmark| benchmark.runs.should == 0 }
@@ -112,4 +92,14 @@ describe BigBench::Executor do
112
92
 
113
93
  end
114
94
 
95
+ it "should generate a new testfile", :generate do
96
+ Dir.chdir "tmp"
97
+
98
+ File.exists?("new_test.rb").should be_false
99
+ argv = ["generate", "new_test"]
100
+ BigBench::Executor::Executable.start(argv)
101
+ File.exists?("new_test.rb").should be_true
102
+ FileUtils.rm "new_test.rb"
103
+ end
104
+
115
105
  end